Skip to content

BUG: IMAP UIDVALIDITY change is not detected, leaving stale cache #1169

@andrinoff

Description

@andrinoff

Describe the bug

When an IMAP server's UIDVALIDITY for a folder changes (rebuild, account migration, some Gmail label edits) every previously-cached UID is invalid. Today we don't read or persist UIDVALIDITY; the next fetch returns whatever new messages happen to live at our cached UIDs and the user sees ghost-message bodies for fresh mail.

Expected behavior

Persist UIDVALIDITY per folder. On every Select, compare; on change, drop the body cache for that folder and trigger a full re-list.

Why it's hard

UIDVALIDITY change is rare in practice — but when it happens, every downstream cache (folder cache, body cache, thread cache, search index) becomes garbage. Detecting and cascading the invalidation across all those layers is the work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions