mattermost-mobile-upstream/app/actions
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
..
app Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
local fix(drafts): wake the coordinator on local mutations + init on DB-recreation paths (#7, #11) 2026-08-05 12:19:51 +02:00
remote fix(drafts): close 3 residual gaps in Phase-4 review fixes (#1, #2, #6) 2026-08-07 12:34:56 +02:00
websocket Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00