Repository navigation
fix(transcript): match missed prompt echoes safely - #1340
Merged
Merged
Conversation
Switching away right after a send could leave the optimistic user row in the live cache under its temporary id; if the user_message_persisted reconcile was missed, reselecting the session merged it beside the durable echo of the same prompt and the question appeared twice (#1308). mergeLiveSessionMessages now grants each durable completed user row one collapse credit: an orphan live user row with equal text consumes one credit and is dropped. A genuinely repeated prompt stays visible because two sends persist two durable rows while each live orphan only consumes one credit. Validated: session-transcript tests 15/15, session-transcript-updates and empty-read suites 10/10; the remaining desktop tsc storage errors reproduce on the pristine main checkout and are unrelated baseline noise.
Match a missed host acknowledgement using exact content, prompt identity, and a tight timestamp window so older identical messages remain visible.
Guard the elapsed-time match so an unrelated same-text row cannot be treated as a missed persistence echo.
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
This completes the original #1334 fix without using message text as identity by itself. A missed prompt acknowledgement is reconciled only for an attachment-free optimistic UUID row with an exact text match and a durable user row timestamped within 30 seconds after it. An older identical prompt remains visible and cannot hide the new prompt.
The original contributor commit is retained in this maintainer follow-up.
Related: #1308, #1334.
Validation
node --test apps/desktop/test/session-transcript.test.mjs apps/desktop/test/session-transcript-updates.test.mjs apps/desktop/test/empty-session-read.test.mjs— 24 passed.node scripts/check-pr-base-main.mjs— passed against48738868fe22.git diff --check— passed.