Repository navigation
fix(web): drafts survive a second tab, a thread switch mid-paste, and empty files - #1026
Merged
Merged
Conversation
… empty files Every tab wrote its whole copy of all drafts to one storage key, so a tab could write its stale copy over a draft another tab had changed. Once another tab writes the key, each write now keeps every draft this tab did not change as storage has it; with one tab open nothing extra is read. The composer cancelled an attachment save when its thread changed, so a paste still being read when the user switched threads was never saved. The save now finishes for the thread it started in; a run made stale by a newer change already writes nothing. An empty file saves as a data URL with no payload, and reading drafts back dropped it; it now comes back as an empty file.
…ver deletes a draft filled elsewhere Each draft write leaves a small writer stamp; a tab reads it before writing instead of waiting for the storage event, so a write that races another tab's still merges. A draft this tab removes as empty keeps the stored copy if another tab has typed into it. An empty saved file must be a real data URL to come back.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 20, 2026
This branch was previously deployed
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.
Three ways a message draft could lose text or files, found while reviewing the Device panel (#1010):
How it's fixed
threadlines:composer-drafts:v1:writer). Before writing, a tab reads that stamp, which is a few bytes.createDebouncedJSONStorage; other stores using it are unchanged.data:URL comes back as an empty file. A broken record is still rejected.Checked
vp fmt,vp lintandvp run typecheckare clean.Left as is