mattermost-mobile-upstream/app
Guillermo Vayá 73488f0b4b fix(drafts): close 3 residual gaps in Phase-4 review fixes (#1, #2, #6)
Re-verification of the 11 Phase-4 review fixes surfaced 3 that were only
partially closed:

#2 (busy loop): drainOutbox skipped a mis-scoped teamId='' row with a bare
`continue`, leaving it Pending-and-due. scheduleWork kept counting it as due
work and re-armed a zero-delay drain that skipped it again — a CPU spin. Now
the skip backs off next_attempt_at (via computeNextAttemptAt), so the row
leaves the due set until its channel/membership may hydrate; a valid drain
resets the count.

#1 (torn-down DB write): the GET/reconcile path wrote the snapshot after the
HTTP await with no post-HTTP guard — only the POST/DELETE workers had one.
reconcileTeamDrafts now takes ReconcileOpts.shouldAbort and re-checks
shouldAbortPostHttpWrite before every per-draft write, failing closed if the
server was torn down mid-GET.

#6 (observation fence too late): the in-flight observation ordinal was bumped
only after reconcileTeamDrafts fully returned (after the whole apply loop),
leaving a window where a concurrent POST ack cleared the outbox first. The
bump now runs synchronously via ReconcileOpts.onSnapshot the moment the GET
resolves, before any apply-loop await.

Adds regression tests for each; all affected suites green (tsc + eslint clean).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-07 12:34:56 +02:00
..
actions fix(drafts): close 3 residual gaps in Phase-4 review fixes (#1, #2, #6) 2026-08-07 12:34:56 +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 3.4 — DraftSyncManager shell (no draining) 2026-07-27 14:49:31 +02:00
context
database feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
helpers
hooks feat(drafts): Phase 3.3 — composer race guards + fail-closed BoR send guard 2026-07-27 17:38:30 +02:00
i18n
init feat(drafts): Phase 4.4 — wire DraftSyncManager lifecycle teardown 2026-08-04 12:52:58 +02:00
keyboard
managers fix(drafts): close 3 residual gaps in Phase-4 review fixes (#1, #2, #6) 2026-08-07 12:34:56 +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