fix(web): avoid false draft attachment persistence warnings#1153
fix(web): avoid false draft attachment persistence warnings#1153shivamhwp wants to merge 2 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 Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
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
c69a429 to
5aa4f85
Compare
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 5aa4f85.