client: Persist draft messages optimistically and on draft events - #6625
Draft
gpunto wants to merge 3 commits into
Draft
client: Persist draft messages optimistically and on draft events#6625gpunto wants to merge 3 commits into
gpunto wants to merge 3 commits into
Conversation
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
Contributor
SDK Size Comparison 📏
|
gpunto
force-pushed
the
fix/draft-events-write-through-to-database
branch
from
August 7, 2026 14:49
7fcb674 to
7d3e3de
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Goal
Stop draft messages from being lost when a request does not complete, and from reappearing after they have been deleted.
Closes AND-1373
Contributes to #6388
Implementation
Aligns three gaps with the iOS SDK (
DraftMessagesRepository,DraftUpdaterMiddleware):onCreateDraftMessageRequest/onDeleteDraftMessagesRequestlistener hooks, dispatched fromdoOnStart, so the local write no longer waits for the response and survives a process death mid-request.draft.updated/draft.deletedonly touchedMutableGlobalState, so a draft deleted on another device left its Room row behind andSyncManagerre-pushed it on every reconnect.draft.deletedhas an empty message id, so deletion keys on cid (or parentId for threads), which needed a new DAO query.No public API change: neither
DraftMessageListenernorMessageRepositoryis in the API dump.Testing
Two emulators against the demo backend:
develop, now stays gone.Unit tests cover both precommit paths and the channel and thread cases for
draft.deleted.