mattermost-mobile-upstream/app
Guillermo Vayá 4b12bcec7b fix(drafts): Phase 5 review — capability re-read, disable epoch, commit ordering, overflow, reliable reconnect
Addresses 5 validated review findings on the Phase 5 trigger wiring:

- #3 Reconnect honored a stale cached capability: doReconnect now awaits
  handleCapabilityChange (re-reading the freshly-committed sync_drafts
  preference) before requestReconcile, so a persisted sync_drafts=false is
  respected on a fresh login.
- #4 Disable did not fence in-flight work: handleCapabilityChange's disable
  branch now bumps the lifecycle epoch (like invalidate) and resets the
  reconcile single-flight, so a GET/POST/DELETE crossing the disabled
  interval cannot apply results or set a baseline after re-enable.
- #5 Team reconcile ran before the switch committed: moved requestReconcile
  in handleTeamChange to after the new team is persisted (both the tablet
  fast-path and the normal path), so a concurrent DB-reading trigger can't
  coalesce the baseline back onto the previous team.
- #6a Reliable reconnect never reconciled: WebsocketManager.onReliableReconnect
  now calls DraftSyncManager.onReliableReconnect, which GET-reconciles the
  current team so silent (event-less) server-side deletions are caught.
- #7 Overflow could permanently stall event-triggered reconcile: enqueue now
  fires the reconcile trigger even on buffer overflow (dropping only the
  push), so a full buffer left by a transient current-team lookup failure
  cannot wedge reconciliation after the database recovers.

Pushed back (not changed): #1 (fence absent keys — would resurrect deleted
drafts; belongs to Phase 6 deleted_fingerprint) and #2 (drain during pending
GET is local-wins-safe, absence is 2-observation guarded). Deferred: #6b
suspend/resume, #8a Global-Drafts stale-on-open, #8b reconciliation deadline.

tsc + eslint clean; new manager tests for #4/#6a/#7 and a reconnect
capability/ordering assertion for #3. All affected suites green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 14:36:43 +02:00
..
actions fix(drafts): Phase 5 review — capability re-read, disable epoch, commit ordering, overflow, reliable reconnect 2026-08-18 14:36:43 +02:00
client feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
components feat(drafts): Phase 3.3 — composer race guards + fail-closed BoR send guard 2026-07-27 17:38:30 +02:00
constants feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
context Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
database feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
helpers Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
hooks feat(drafts): Phase 3.3 — composer race guards + fail-closed BoR send guard 2026-07-27 17:38:30 +02:00
i18n Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
init feat(drafts): Phase 4.4 — wire DraftSyncManager lifecycle teardown 2026-08-04 12:52:58 +02:00
keyboard resumes slide animation after stopping due to modal system dialog showing (#9792) 2026-05-29 06:50:57 +08:00
managers fix(drafts): Phase 5 review — capability re-read, disable epoch, commit ordering, overflow, reliable reconnect 2026-08-18 14:36:43 +02:00
products [MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) 2026-07-16 20:13:11 -04:00
queries feat(drafts): Phase 3.2 — route Draft deletion by origin 2026-07-27 14:39:18 +02:00
routes Route through usePropsFromParams for remaining stragglers (#9949) 2026-07-18 19:16:46 +03:00
screens fix: push notification navigation delay and stale in-app avatar (#9929) 2026-07-22 14:15:21 +02:00
store fix: push notification navigation delay and stale in-app avatar (#9929) 2026-07-22 14:15:21 +02:00
utils feat(drafts): Phase 4.1 — additive snapshot reconciliation (read path) 2026-08-04 12:11:44 +02:00