mattermost-mobile-upstream/app
Guillermo Vayá 5cb2fbedb8 feat(drafts): Phase 3.3 — composer race guards + fail-closed BoR send guard
Guard the composer against draft resurrection now that removeDraft enqueues a
durable DELETE, and fail closed on unreconstructable burn-on-read sends.

- Add per-composer editor_guard module (keyed by serverUrl:channelId:rootId):
  tracks genuine unsaved edits + a generation bumped on Send/Delete. Shared by
  the save site and the invalidation sites; avoids prop-drilling.
- post_input: route blur/background/unmount through guardedSave, which no-ops
  when the editor is clean and discards its write (via a captured-generation
  staleness check) if Send/Delete invalidated the editor mid-save. Genuine
  typing marks dirty; an external/remote value change resets the baseline clean;
  unmount clears the entry.
- draft_handler.clearDraft and deleteDraftConfirmation invalidate the editor so a
  pending lifecycle save cannot recreate a just-sent/deleted draft.
- handleDraftUpdate discards stale markdown-image metadata when the editor
  generation changed during the async parse.
- handle_send_message: fail-closed burn-on-read guard on both send paths — an
  enabled BoR send with invalid/missing durations shows a localized error, keeps
  the draft, and never creates a downgraded plain post. Adds one en.json string.

Checks: npm run tsc clean; eslint --quiet clean; 126 Jest tests pass (editor
guard, handle_send_message incl. BoR fail-closed, draft actions, draft utils).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 17:38:30 +02:00
..
actions feat(drafts): Phase 3.2 — route Draft deletion by origin 2026-07-27 14:39:18 +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 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 Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
keyboard resumes slide animation after stopping due to modal system dialog showing (#9792) 2026-05-29 06:50:57 +08:00
managers feat(drafts): Phase 3.4 — DraftSyncManager shell (no draining) 2026-07-27 14:49:31 +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 3.3 — composer race guards + fail-closed BoR send guard 2026-07-27 17:38:30 +02:00