Repository navigation
fix(widget): keep the page-action ack per session visitor - #27
Merged
Merged
Conversation
The ack of the action manifest was keyed by conversation id only, and the conversation id survives a sign-in, a sign-out or a different user on the same browser. The backend conversation belongs to the session visitor, so after an identity change the widget sent a stale actionsHash and the backend left the manifest out of a conversation that had never seen it. Key the ack by the session visitorId as well, resolve the session before building the chat body, record which visitor answered, and drop the ack when a 401 retry runs for another visitor. Closes #26 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
actionsHash) was stored perconversationIdonly. That id survives a sign-in, a sign-out or another user on the same browser, but the backend conversation belongs to the session visitor. After signing in, the widget sent the anonymous ack and the server left the manifest out, so the agent improvised the directive format.visitorIdas well. The widget resolves the session before building the chat body, records which visitor answered the run, and drops the ack when a 401 retry runs for a different visitor.docs/http-contract.mddescribes the per-visitor ack.Tests
test/widget-actions-ack-identity.test.ts: anonymous → sign-in → second user → sign-out withrenewSession(), a signed-in page reload with the persisted ack, and a 401 retry for another visitor. The first two fail onmainand pass here.pnpm typecheck,pnpm test(256 passed),pnpm build,pnpm test:bundlerspass locally.Closes #26
🤖 Generated with Claude Code