From e9eccb6ef6b5c9c1e16f8cf8d2ec4c1965401f02 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 30 Oct 2025 13:01:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(cli):=20correct=20rule=20exe?= =?UTF-8?q?cution=20order=20for=20trash=20and=20delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - correct the order of rule execution to delete before trashing - trashed messages will not be deleted --- src/cli/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/main.rs b/src/cli/main.rs index a8a284b..43ae7a7 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -455,7 +455,7 @@ fn get_config() -> Result<(Config, ClientConfig)> { /// Executes automated message retention rules across Gmail labels by action. /// /// This function orchestrates the rule-based message processing workflow by: -/// 1. Executing rules by action: `Trash` first, then `Delete` +/// 1. Executing rules by action: `Delete` first, then `Trash` /// 2. Organizing rules by their target labels /// 3. Processing each label according to its configured rule /// 4. Executing or simulating actions based on execution mode @@ -489,8 +489,8 @@ fn get_config() -> Result<(Config, ClientConfig)> { /// The function continues processing even if individual rules fail, logging /// warnings for missing rules, processing errors, or action failures. async fn run_rules(client: &mut GmailClient, rules: Rules, execute: bool) -> Result<()> { - run_rules_for_action(client, &rules, execute, EolAction::Trash).await?; run_rules_for_action(client, &rules, execute, EolAction::Delete).await?; + run_rules_for_action(client, &rules, execute, EolAction::Trash).await?; Ok(()) }