mattermost-mobile-upstream/app/database/models/server
Guillermo Vayá 354e956f43 feat(drafts): Phase 1 synchronized-drafts storage foundation
Adds the durable storage foundation for synchronized drafts (mobile-only,
no network behavior yet):

- Fix draft batch dedup in handleDraft to key by the composite
  (channel_id, root_id) instead of channel_id alone, so a channel draft
  and its thread reply drafts in the same batch no longer collapse.
- Add Draft columns: server_update_at (nullable ancestry hint, not a
  revision), props (JSON), file_ids (JSON portable server attachment IDs).
- Add the DraftOutbox table (one durable pending op per draft key) with
  operation/status const objects, generation, keep_local, retry fields,
  and a deleted_fingerprint column for delete-vs-newer-write disambiguation.
- Add buildDraftOutboxId, the serialized mutateDraftAndOutbox writer
  primitive (enters database.write before querying both tables, commits one
  batch), and deterministic repairDuplicateDrafts.
- Bump server schema 20 -> 21 with addColumns + createTable migration;
  register schema/model in the database managers, mocks, types, and docs.

Tests: composite-key survival, concurrent-mutation serialization, batch
failure atomicity, duplicate repair winner, model round-trip / migration
compatibility, and migration definition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 16:18:48 +02:00
..
category_channel.ts
category.ts
channel_bookmark.ts
channel_info.ts
channel_membership.ts
channel.ts
config.ts
custom_emoji.ts
custom_profile_attribute.ts
custom_profile_field.ts
draft_outbox.ts
draft.ts
file.ts
group_channel.ts
group_membership.ts
group_team.ts
group.ts
index.ts
my_channel_settings.ts
my_channel.ts
my_team.ts
post.ts
posts_in_channel.ts
posts_in_thread.ts
preference.ts
property_field.ts
property_value.ts
reaction.ts
role.ts
scheduled_post.ts
system.ts
team_channel_history.ts
team_membership.ts
team_search_history.ts
team_threads_sync.ts
team.ts
thread_in_team.ts
thread_participant.ts
thread.ts
user.ts