mattermost-mobile-upstream/app/queries/servers
Guillermo Vayá 1013adb891 feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability
Client, mapping, and capability layer only — intentionally NOT wired into any
lifecycle/trigger path yet (no coordinator, no workers).

- types/api/drafts.d.ts: add DraftApi (server response) and DraftUpsertRequest
  (POST body) DTOs alongside DraftProps.
- types/api/config.d.ts: add AllowSyncedDrafts to ClientConfig.
- client/rest/base.ts: add draft route helpers (drafts POST, user/team GET,
  channel/thread DELETE).
- client/rest/drafts.ts (+test): ClientDrafts mixin — getDrafts, upsertDraft,
  deleteDraft (channel vs thread by rootId), Connection-Id header on POST/DELETE.
  Mixed into client/rest/index.ts (also drops a pre-existing duplicate
  ClientScheduledPost entry in the .with() list).
- constants/preferences.ts: add ADVANCED_SYNC_DRAFTS ('sync_drafts').
- utils/draft/sync.ts (+test): pure bidirectional normalization. server->mobile
  maps update_at->server_update_at (never local update_at), priority, props
  passthrough, exact file_ids, files from metadata.files; mobile->server sends
  only channel_id/root_id/message/type/props/file_ids/priority and returns null
  for an empty message so it never POSTs. Fail-closed burn-on-read reconstruction
  (durations come from server config, not props; missing/invalid -> no enabled
  borConfig).
- queries/servers/drafts.ts: getIsDraftSyncEnabled / observeIsDraftSyncEnabled —
  enabled when AllowSyncedDrafts==='true' AND sync_drafts pref not 'false'
  (absent = enabled). No server-version gate.

Checks: npm run tsc clean; eslint --quiet clean; 69 focused Jest tests pass
across the new client/sync suites and the scheduled_post/post-handler/drafts
regression neighbors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 11:49:47 +02:00
..
categories.ts [MM-68255] Enable mobile support for Managed Categories (#9683) 2026-04-16 10:01:51 -04:00
channel_bookmark.ts fix bookmarks sort order when WS does not bump update_at (#8264) 2024-10-17 09:05:01 +08:00
channel.nomock.test.ts Unify Is Read Only logic to avoid code repetition and improve redability (#8720) 2025-04-06 17:50:19 +02:00
channel.test.ts [MM-67253] Add support for DMs and GMs for autotranslations (#9505) 2026-02-16 16:32:02 +01:00
channel.ts [MM-67253] Add support for DMs and GMs for autotranslations (#9505) 2026-02-16 16:32:02 +01:00
custom_emoji.ts [Gekidou] Extract common observers to queries (#5984) 2022-03-23 09:19:29 -03:00
custom_profile.test.ts [MM-62565] Custom Profile attributes websocket changes (#8758) 2025-05-27 16:24:40 +02:00
custom_profile.ts [MM-62565] Custom Profile attributes websocket changes (#8758) 2025-05-27 16:24:40 +02:00
drafts.test.ts fix(drafts): address Phase 1 review findings 2026-07-23 17:20:52 +02:00
drafts.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
entry.test.ts Remove playbooks on delete channel (#8994) 2025-07-17 11:54:14 +02:00
entry.ts fix critical crashes on Android (#9871) 2026-06-23 02:40:21 +08:00
features.ts Add GM as DM feature support (#7515) 2023-09-26 18:35:40 +02:00
file.ts Viewing Files in Edit mode in mobile with ability to delete and save (#8918) 2025-06-20 01:03:57 +05:30
group.ts Sanitize sqlite like queries and allow non-latin characters (#7141) 2023-02-16 11:18:05 +02:00
post.test.ts Revert "e2e(detox): Rainforest to Detox migration (#9790)" (#9834) 2026-06-15 17:57:01 +02:00
post.ts [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
preference.test.ts MM-59787 Add tests for preference query functions (#8530) 2025-01-29 17:10:21 -05:00
preference.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +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
reaction.ts Do not access record children directly to avoid crashes if the child is not present in the db (#7028) 2023-01-27 17:57:38 +02:00
role.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
role.ts [MM-67923] Add channel settings for shared channels (#9591) 2026-04-14 11:43:44 +02:00
scheduled_post.test.ts Remaining test for draft and Scheduled post (#8887) 2025-07-01 13:47:02 +05:30
scheduled_post.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
security.test.ts Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
security.ts Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
system.test.ts Revert "e2e(detox): Rainforest to Detox migration (#9790)" (#9834) 2026-06-15 17:57:01 +02:00
system.ts Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
team.test.ts Remove playbooks on delete channel (#8994) 2025-07-17 11:54:14 +02:00
team.ts Remove playbooks on delete channel (#8994) 2025-07-17 11:54:14 +02:00
terms_of_service.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
terms_of_service.ts Update Dependencies and bug fixes (#7000) 2023-01-24 09:14:23 +02:00
thread.ts fix: app bugs surfaced by Detox RF migration (#9789) 2026-06-09 13:25:42 +05:30
user.ts Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00