Skip to content

Commit e9eccb6

Browse files
gortavoherjerusdp
authored andcommitted
🐛 fix(cli): correct rule execution order for trash and delete
- correct the order of rule execution to delete before trashing - trashed messages will not be deleted
1 parent dc41101 commit e9eccb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cli/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ fn get_config() -> Result<(Config, ClientConfig)> {
455455
/// Executes automated message retention rules across Gmail labels by action.
456456
///
457457
/// This function orchestrates the rule-based message processing workflow by:
458-
/// 1. Executing rules by action: `Trash` first, then `Delete`
458+
/// 1. Executing rules by action: `Delete` first, then `Trash`
459459
/// 2. Organizing rules by their target labels
460460
/// 3. Processing each label according to its configured rule
461461
/// 4. Executing or simulating actions based on execution mode
@@ -489,8 +489,8 @@ fn get_config() -> Result<(Config, ClientConfig)> {
489489
/// The function continues processing even if individual rules fail, logging
490490
/// warnings for missing rules, processing errors, or action failures.
491491
async fn run_rules(client: &mut GmailClient, rules: Rules, execute: bool) -> Result<()> {
492-
run_rules_for_action(client, &rules, execute, EolAction::Trash).await?;
493492
run_rules_for_action(client, &rules, execute, EolAction::Delete).await?;
493+
run_rules_for_action(client, &rules, execute, EolAction::Trash).await?;
494494

495495
Ok(())
496496
}

0 commit comments

Comments
 (0)