You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Image compression recreates a discarded composer draft and blocks Undo #36731
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Type a prompt in a thread and paste a screenshot that needs resizing.
While the image is preparing, switch to another thread and discard the source thread's draft from the sidebar.
Allow compression to finish. The discarded thread shows an unsent draft again.
Alternatively, type in a new-thread draft, navigate away and back so its sidebar row is present, paste the image, discard that active draft while preparing, then click Undo after compression finishes.
The deterministic repro uses a generated PNG wider than the image limit, runs production compression, and holds createImageBitmap until discard has finished. No provider is needed.
Expected behavior
Discard stays effective after compression finishes, and Undo restores the saved prompt.
Actual behavior
Late compression recreates an image-only draft for the discarded target. The thread's unsent-draft marker returns. For the discarded new-thread draft, Undo shows “Failed to restore draft” with “The draft has new content.” and does not restore the draft.
Linux, Chromium, web client with isolated scenario state. Client-side composer intake; provider independent.
Logs or stack traces
The supplied hook repro fails for both discard targets on main. Paired real-app scenarios also fail on base and pass with cancellation at discard. Found by the bughunt, independently confirmed by Claude Opus 5.5, and reproved for this fix.
Activity