mattermost-mobile-upstream/app/queries
Guillermo Vayá cb16a8eba0 feat(drafts): Phase 3.2 — route Draft deletion by origin
Generic relation/cache cleanup must never silently discard durable draft sync
intent. Strip drafts from every generic cascade and remove clean reply drafts
only at the confirmed-server-post-deletion origin.

- prepareDeletePost: drop post.drafts from the cascade.
- prepareDeleteChannel: drop channel.drafts from the cascade (channel
  delete/leave/purge now preserves Draft + DraftOutbox).
- deletePosts: drop the DELETE FROM Draft SQL (data-retention eviction preserves
  drafts + outbox).
- Add prepareDeleteCleanReplyDrafts(database, rootIds): removes only CLEAN reply
  drafts (no DraftOutbox row) for confirmed-deleted roots, never enqueues a
  DELETE; preserves reply drafts with pending local intent (local-wins); never
  touches channel drafts.
- Wire it into preparePostDeletion (the removePost/removePosts confirmed path).

Checks: npm run tsc clean; eslint --quiet clean; 241 Jest tests pass across the
post/channel/drafts query + post/draft action suites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 14:39:18 +02:00
..
app Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
servers feat(drafts): Phase 3.2 — route Draft deletion by origin 2026-07-27 14:39:18 +02:00