Skip to content

fix(widget): keep the page-action ack per session visitor - #27

Merged
mrgoonie merged 1 commit into
mainfrom
claude/fix-26-stale-actions-ack-8b2c19
Nov 1, 2026
Merged

mrgoonie merged 1 commit into
mainfrom
claude/fix-26-stale-actions-ack-8b2c19

Conversation

@mrgoonie

@mrgoonie mrgoonie commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The page-action ack (actionsHash) was stored per conversationId only. 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.
  • The ack is now keyed by the session visitorId as 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.
  • No public API or wire change. The server is unchanged; docs/http-contract.md describes the per-visitor ack.

Tests

  • New test/widget-actions-ack-identity.test.ts: anonymous → sign-in → second user → sign-out with renewSession(), a signed-in page reload with the persisted ack, and a 401 retry for another visitor. The first two fail on main and pass here.
  • pnpm typecheck, pnpm test (256 passed), pnpm build, pnpm test:bundlers pass locally.

Closes #26

🤖 Generated with Claude Code

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>
@mrgoonie
mrgoonie merged commit e474080 into main Nov 1, 2026
2 checks passed
@mrgoonie mrgoonie mentioned this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale actionsHash ack after sign-in hides page-action manifest from the agent

1 participant