Skip to content

fix(email): Apply labels to drafts#1983

Merged
evanhutnik merged 2 commits intomainfrom
evan/mark-drafts-2
Mar 16, 2026
Merged

fix(email): Apply labels to drafts#1983
evanhutnik merged 2 commits intomainfrom
evan/mark-drafts-2

Conversation

@evanhutnik
Copy link
Copy Markdown
Contributor

Summary

  • thread_labels.rs: Draft messages (no provider_id) are now separated from provider messages. Drafts are added directly to successful_ids for DB label updates instead of being skipped entirely. Gmail API calls are only made for provider messages.
  • archived.rs: Drafts get their INBOX label added/removed in the DB when archiving/unarchiving, but are excluded from the Gmail API batch call since they don't exist in Gmail.
  • seen.rs: Same pattern — drafts get their UNREAD label removed and read status updated in the DB, but aren't sent to the Gmail API.

Previously, label operations (TRASH, INBOX, UNREAD, etc.) completely skipped draft messages, which meant trashed threads with drafts would still appear in importance-filtered inbox queries because the draft messages never received the TRASH label.

@evanhutnik evanhutnik merged commit fd76f14 into main Mar 16, 2026
38 checks passed
@evanhutnik evanhutnik deleted the evan/mark-drafts-2 branch March 16, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant