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 Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
category.ts MM-54887 Fix category order being reversed after moving a channel (#7628) 2023-10-24 16:21:14 -04:00
channel_bookmark.ts Channel Bookmarks (#7817) 2024-07-18 09:10:28 +08:00
channel_info.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
channel_membership.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
channel.ts Database changes for autotranslations (#9495) 2026-02-10 15:04:35 +01:00
config.ts Move config to its own database table (#6744) 2022-11-11 21:20:42 +04:00
custom_emoji.ts Gekidou - Fix to make all models implement their respective interface (#6099) 2022-03-29 17:41:46 -03:00
custom_profile_attribute.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
custom_profile_field.ts [MM-62700] User Attribute types (#8903) 2025-06-12 10:59:13 +02:00
draft_outbox.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
draft.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
file.ts Add is_blocked to FileModel (#8842) 2025-05-07 15:33:04 +08:00
group_channel.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
group_membership.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
group_team.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
group.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
index.ts feat(drafts): Phase 1 synchronized-drafts storage foundation 2026-07-23 16:18:48 +02:00
my_channel_settings.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
my_channel.ts Database changes for autotranslations (#9495) 2026-02-10 15:04:35 +01:00
my_team.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
post.ts Use message source on post edit (#7325) 2023-05-11 14:18:07 +02:00
posts_in_channel.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
posts_in_thread.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
preference.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
property_field.ts Add BoardView, PropertyField, PropertyValue WatermelonDB tables (#9708) 2026-06-01 12:46:40 +02:00
property_value.ts Add BoardView, PropertyField, PropertyValue WatermelonDB tables (#9708) 2026-06-01 12:46:40 +02:00
reaction.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
role.ts Add Playbooks read-only support for mobile devices (#8978) 2025-07-14 09:21:37 +02:00
scheduled_post.ts BoR scheduled posts and drafts DB migrations (#9352) 2025-12-18 11:26:24 +05:30
system.ts Gekidou - Fix to make all models implement their respective interface (#6099) 2022-03-29 17:41:46 -03:00
team_channel_history.ts Add Playbooks read-only support for mobile devices (#8978) 2025-07-14 09:21:37 +02:00
team_membership.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
team_search_history.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
team_threads_sync.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
team.ts Add Playbooks read-only support for mobile devices (#8978) 2025-07-14 09:21:37 +02:00
thread_in_team.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
thread_participant.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
thread.ts Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
user.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00