mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-07 03:10:12 +00:00
First network activity: pull the server's draft snapshot for the active team
and apply it additively. No absence-based deletion and no POST/DELETE workers
yet (later sub-steps) — a Draft is never removed for being missing from the
response, and nothing is applied when the GET fails.
- actions/remote/draft.ts: fetchDraftsForTeam (GET via ClientDrafts, forceLogout
+ non-PII error, fail-closed) and reconcileTeamDrafts — adopt legacy drafts
first, normalize each server draft (BoR durations read from config, fail
closed), restrict to confirmed-membership + DM/GM channels, and apply the
incoming matrix per key via mutateDraftAndOutbox:
* DELETE outbox -> fingerprint match preserves the delete, differ abandons it
and adopts server content;
* pending upsert -> local wins, merge server props + record serverUpdateAt;
* waiting/blocked_upload -> apply remote portable fields, preserve local files;
* blocked/unsyncable_empty -> preserve;
* no outbox -> create, or update a clean draft only when content differs.
Missing channel skips one key without aborting others; a missing root never
blocks a reply draft.
- DraftSyncManager: single-flight, epoch-guarded reconcile with coalescing;
baseline recorded only on epoch-valid success; still no draining/POST/DELETE.
Checks: npm run tsc clean; eslint --quiet clean; 125 Jest tests pass (remote
draft, manager, draft actions/queries/sync).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| index.test.ts | ||
| index.ts | ||
| sync.test.ts | ||
| sync.ts | ||