Skip to content

[Thread] Enable collapseThreads without Force Query Path (on Cache-first Path + Cache Invalidation) #4401

@dab246

Description

@dab246

Related

  • ADR-0071 (Cache-first path: FORCE_EMAIL_QUERY = false)

Description

Pass collapseThreads: true on the cache-first path (getAllEmail()) when thread mode is enabled. Handle cache inconsistency when user toggles thread ON/OFF by clearing the email cache on toggle.

Problem

The local DB reflects whichever collapseThreads mode it was built under:

  • OFF to ON: cache has individual emails, server returns collapsed — stale first yield
  • ON to OFF: cache has collapsed emails, server returns all — missing emails in first yield

Tasks

  • In ThreadRepositoryImpl.getAllEmail(), set collapseThreads: true when thread is enabled
  • Update GetEmailsInMailboxInteractor and related interactors to propagate thread status
  • Clear email cache in the thread setting toggle handler (enable to disable and vice versa)
  • After cache clear, ensure getAllEmail() rebuilds cache under the correct mode

Acceptance Criteria

  • Cache-first path returns collapsed emails when thread is enabled
  • Toggle OFF to ON: cache is cleared, reloads with collapsed data
  • Toggle ON to OFF: cache is cleared, reloads with individual emails
  • No stale data displayed after toggling

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions