mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-07 03:10:12 +00:00
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>
|
||
|---|---|---|
| .. | ||
| apps.ts | ||
| base.test.ts | ||
| base.ts | ||
| categories.test.ts | ||
| categories.ts | ||
| channel_bookmark.test.ts | ||
| channel_bookmark.ts | ||
| channels.test.ts | ||
| channels.ts | ||
| constants.ts | ||
| custom_profile_attributes.test.ts | ||
| custom_profile_attributes.ts | ||
| drafts.test.ts | ||
| drafts.ts | ||
| emojis.test.ts | ||
| emojis.ts | ||
| error.ts | ||
| files.test.ts | ||
| files.ts | ||
| general.test.ts | ||
| general.ts | ||
| groups.test.ts | ||
| groups.ts | ||
| index.test.js | ||
| index.ts | ||
| integrations.test.ts | ||
| integrations.ts | ||
| nps.test.ts | ||
| nps.ts | ||
| plugins.test.ts | ||
| plugins.ts | ||
| posts.test.ts | ||
| posts.ts | ||
| preferences.test.ts | ||
| preferences.ts | ||
| properties.test.ts | ||
| properties.ts | ||
| scheduled_post.test.ts | ||
| scheduled_post.ts | ||
| teams.test.ts | ||
| teams.ts | ||
| threads.test.ts | ||
| threads.ts | ||
| tos.test.ts | ||
| tos.ts | ||
| tracking.test.ts | ||
| tracking.ts | ||
| users.test.ts | ||
| users.ts | ||