fix(chat): restore double Enter and reliable immediate sends - #8237
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
| async (id?: string) => { | ||
| const queue = useMothershipQueueStore.getState().queues[chatKeyRef.current] | ||
| const msg = queue?.find((queued) => queued.id === id) | ||
| const msg = id === undefined ? queue?.[0] : queue?.find((queued) => queued.id === id) |
There was a problem hiding this comment.
Queued edit sent prematurely When someone is editing the first queued message during an active response, they can clear the composer and press Enter. This path sends that message’s original content without checking whether it is being edited, so the correction can go out before the user finishes it. The automatic queue sender already pauses for an edited message, but this immediate-send path bypasses that check; the new organization composer callback exposes the same path there.
Summary
Restore double Enter during streaming in organization Search and Build: the first Enter queues the draft, and the second sends the current queue head after the active response stops. Resolve the head from the live queue instead of a rendered snapshot, consume attachments synchronously to prevent duplicate sends, and poll an acknowledged worker stop within a bounded deadline so normal cleanup does not prematurely return the correction to Retry.
Type of Change
Testing
bun run type-checkandbun run check:api-validationpass.Checklist