mattermost-mobile-upstream/app/client/rest
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
..
apps.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
base.test.ts [MM-67923] Add channel settings for shared channels (#9591) 2026-04-14 11:43:44 +02:00
base.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
categories.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
categories.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channel_bookmark.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channel_bookmark.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channels.test.ts [MM-68255] Enable mobile support for Managed Categories (#9683) 2026-04-16 10:01:51 -04:00
channels.ts [MM-68255] Enable mobile support for Managed Categories (#9683) 2026-04-16 10:01:51 -04:00
constants.ts Fix case-insensitive pre-auth header check in doPing (#9577) 2026-03-17 12:07:07 +01:00
custom_profile_attributes.test.ts [MM-62701] [MM-62176]Edit custom profile attributes in user profile (#8557) 2025-02-19 15:51:59 +01:00
custom_profile_attributes.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
drafts.test.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
drafts.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
emojis.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
emojis.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
error.ts feat: show pre-auth secret error on field on server create (#9102) 2025-09-17 08:04:28 +02:00
files.test.ts [GH-8911] Fix file upload request when CSRF protection is enabled (#8912) 2025-10-01 11:00:55 -03:00
files.ts [GH-8911] Fix file upload request when CSRF protection is enabled (#8912) 2025-10-01 11:00:55 -03:00
general.test.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
general.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
groups.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
groups.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
index.test.js [Gekidou] Fix & small refactor to the app entry logic and WS reconnection (#5937) 2022-02-09 12:49:37 -03:00
index.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
integrations.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
integrations.ts Add Multiselect, Dynamic Select, Multiform, and Field Refresh Support for Interactive Dialogs (#9484) 2026-03-18 15:15:08 -06:00
nps.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
nps.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
plugins.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
plugins.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
posts.test.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
posts.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
preferences.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
preferences.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
properties.test.ts [MM-68255] Enable mobile support for Managed Categories (#9683) 2026-04-16 10:01:51 -04:00
properties.ts MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
scheduled_post.test.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
scheduled_post.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
teams.test.ts Add guest invites (#9288) 2025-12-11 17:21:18 +01:00
teams.ts Add guest invites (#9288) 2025-12-11 17:21:18 +01:00
threads.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
threads.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
tos.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
tos.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
tracking.test.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
tracking.ts feat(MM-65145): low connectivity manager (#9283) 2025-12-04 10:44:33 -07:00
users.test.ts Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
users.ts Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00