mattermost-mobile-upstream/app/actions/websocket
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
..
burn_on_read.test.ts Bor create post (#9393) 2026-02-09 17:00:54 +05:30
burn_on_read.ts Bor create post (#9393) 2026-02-09 17:00:54 +05:30
category.test.ts Add tests to remaining actions/websocket files (#8495) 2025-01-21 08:42:09 -05:00
category.ts Add tests to remaining actions/websocket files (#8495) 2025-01-21 08:42:09 -05:00
channel.test.ts Keep users in archived channels when server omits ExperimentalViewArchivedChannels (MM-65820) (#9815) 2026-06-09 19:47:37 +00:00
channel.ts fix critical crashes on Android (#9871) 2026-06-23 02:40:21 +08:00
draft.test.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
draft.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
event.test.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
event.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
files.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
files.ts [MM-69457] Stop logging PII in exportable app logs (#9884) 2026-07-02 12:19:04 +02:00
group.test.ts Add tests to index, group and users websocket actions (#8486) 2025-01-17 14:25:12 -05:00
group.ts Move config to its own database table (#6744) 2022-11-11 21:20:42 +04:00
index.test.ts fix(drafts): Phase 5 review — capability re-read, disable epoch, commit ordering, overflow, reliable reconnect 2026-08-18 14:36:43 +02:00
index.ts fix(drafts): Phase 5 review — capability re-read, disable epoch, commit ordering, overflow, reliable reconnect 2026-08-18 14:36:43 +02:00
integrations.test.ts Add tests to remaining actions/websocket files (#8495) 2025-01-21 08:42:09 -05:00
integrations.ts Gekidou Android share extension (#6803) 2022-11-30 23:18:56 +02:00
managed_categories.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
managed_categories.ts [MM-68255] Enable mobile support for Managed Categories (#9683) 2026-04-16 10:01:51 -04:00
posts.test.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
posts.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
preferences.test.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
preferences.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
properties.test.ts MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
properties.ts MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
reactions.test.ts Add tests to remaining actions/websocket files (#8495) 2025-01-21 08:42:09 -05:00
reactions.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
roles.test.ts Add model mocks to TestHelper (#8715) 2025-03-28 09:40:08 +01:00
roles.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
scheduled_post.test.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
scheduled_post.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
system.test.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
system.ts feat(drafts): Phase 5 — WebSocket + lifecycle triggers make sync live 2026-08-15 16:50:19 +02:00
teams.test.ts Add model mocks to TestHelper (#8715) 2025-03-28 09:40:08 +01:00
teams.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
threads.test.ts Add tests to remaining actions/websocket files (#8495) 2025-01-21 08:42:09 -05:00
threads.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
users.test.ts [MM-62565] Custom Profile attributes websocket changes (#8758) 2025-05-27 16:24:40 +02:00
users.ts Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00