mattermost-mobile-upstream/app/managers
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
..
draft_sync_manager fix(drafts): close 3 residual gaps in Phase-4 review fixes (#1, #2, #6) 2026-08-07 12:34:56 +02:00
draft_upload_manager Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
ephemeral_mode_manager feat(drafts): Phase 4.4 — wire DraftSyncManager lifecycle teardown 2026-08-04 12:52:58 +02:00
intune_manager Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
performance_metrics_manager Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
security_manager Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
apps_manager.test.ts
apps_manager.ts
global_event_handler.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
global_event_handler.ts [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
integrations_manager.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
network_manager.ts Fix Regressions (#9808) 2026-06-04 06:54:40 +08:00
network_performance_manager.test.ts
network_performance_manager.ts
session_manager.test.ts Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
session_manager.ts Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
websocket_manager.test.ts Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
websocket_manager.ts Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00