-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
Description
Related
- ADR-0072
Description
When a user performs an action (mark read, star, move, delete, etc.) on one or more threads in the email list, the system must:
- Expand
ThreadIdtoList<EmailInThreadDetailInfo> - Execute the action on all emails in the thread
- Update UI immediately before server response (optimistic UI)
- Handle rollback on failure
Tasks
Thread Expansion Service
- Create
ThreadExpansionServicewith in-memory cache, parallel execution, and error isolation - Create
ThreadExpansionResultdata model (emailThreadInfos+errors) - Implement
expandThreads()reusingThreadDetailRepository.getThreadById
Thread-aware Interactors
- Create
ThreadActionResultmodel (success,actionErrors,expansionErrors) - Create
MarkAsThreadReadInteractorβ expand threads, then delegate to existing email interactor - Create
MoveThreadInteractorβ expand threads, then delegate to existing move logic - Create other thread-aware interactors (star, delete, etc.) following the same pattern
Optimistic UI
- Call
updateEmailFlagByEmailIds()before interactor execution (optimistic update) - On failure: rollback via inverse operation (e.g., markAsRead to markAsUnread)
- On partial success: rollback only failed email IDs
- Sync thread detail UI via
dispatchThreadDetailUIAction(UpdatedEmailKeywordsAction(...))
Cache Invalidation
- Clear
ThreadExpansionServicecache in:ThreadController.refreshAllEmail()ThreadController.refreshChangeEmail()collapseThreadstoggle handler- After thread action completes
Acceptance Criteria
- Action on a thread applies to all emails within that thread
- UI updates instantly without waiting for server response
- On failure: UI rolls back to previous state
- On partial success: only failed emails are rolled back
- One thread expansion failure does not block other threads
Reactions are currently unavailable