fix(web): avoid false draft attachment persistence warnings#1153
Open
shivamhwp wants to merge 3 commits intopingdotgg:mainfrom
Open
fix(web): avoid false draft attachment persistence warnings#1153shivamhwp wants to merge 3 commits intopingdotgg:mainfrom
shivamhwp wants to merge 3 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c69a429 to
5aa4f85
Compare
Flush pending composer draft writes before verifying persisted attachments so image drafts are not incorrectly marked as unsaved due to the debounce window. Made-with: Cursor
5aa4f85 to
54935e5
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.
Summary
Fixes #979
Before


After
Why
The composer draft store debounces
localStoragewrites, but attachment verification was reading storage immediately in a microtask. That could race the pending write and incorrectly flag persisted attachments as non-persisted, which surfaced the "Draft attachment could not be saved locally" warning even when persistence would have succeeded.Test plan
bun fmtbun lintbun typecheckUI evidence
Made with Cursor
Note
[!NOTE]
Fix false draft attachment persistence warnings in composer draft store
verifyPersistedAttachmentshelper in composerDraftStore.ts that flushes pending debounced storage writes before reading persisted attachment IDs, preventing race conditions where attachments appeared unpersisted.nonPersistedImageIdsis empty after the debounced write is flushed.Macroscope summarized fdc52aa.