🐛 fix(rule_processor): fix label creation and message retrieval

- fix label creation by removing async
- fix message retrieval by renaming run to get_messages
This commit is contained in:
Jeremiah Russell
2025-10-14 07:27:04 +01:00
committed by Jeremiah Russell
parent 50a3b394de
commit b1fc7f713a

View File

@@ -54,7 +54,7 @@ impl RuleProcessor for GmailClient {
/// Find the rule and messages for the label /// Find the rule and messages for the label
async fn find_rule_and_messages_for_label(&mut self, label: &str) -> Result<()> { async fn find_rule_and_messages_for_label(&mut self, label: &str) -> Result<()> {
self.add_labels(&[label.to_string()]).await?; self.add_labels(&[label.to_string()])?;
if self.label_ids().is_empty() { if self.label_ids().is_empty() {
return Err(Error::LabelNotFoundInMailbox(label.to_string())); return Err(Error::LabelNotFoundInMailbox(label.to_string()));
@@ -141,7 +141,7 @@ impl RuleProcessor for GmailClient {
// } // }
/// Prepare the message list for delete to be completed on execute by batch_delete /// Prepare the message list for delete to be completed on execute by batch_delete
async fn prepare(&mut self, pages: u32) -> Result<()> { async fn prepare(&mut self, pages: u32) -> Result<()> {
self.run(pages).await self.get_messages(pages).await
} }
/// Run the batch delete on the selected messages /// Run the batch delete on the selected messages