Skip to content

bug(ui): Anonymous public-chat history never restores after reload (session id lowercased on lookup) #3443

Closed

Description

@vybe

Summary

The empty "Start a Conversation" state. GET /api/public/history/<token>?session_id=<id> returns 200 with {"messages":[],"message_count":0}; the client sends the stored id with its case intact.

Category: functional · Severity: Critical · Validated: source

Context

Found by the click-through UI sweep of a local instance (dev @ c90c711ee, 1.0.0-rc1), fixture agents only.

Repro

  1. Create a public link on an agent whose access policy has the email gate off.
  2. Open /chat/<token> logged out (1440, light) and send one message.
  3. Reload the page.

Expected

The visitor's conversation is restored after a reload ("Refresh keeps place").

Observed

The empty "Start a Conversation" state. GET /api/public/history/<token>?session_id=<id> returns 200 with {"messages":[],"message_count":0}; the client sends the stored id with its case intact.

Validation

src/backend/db/public_chat.py:146 — the lookup compares session_identifier == session_identifier.lower() unconditionally, while the create path (line 84) lowercases only when identifier_type == 'email', so a mixed-case anonymous token never matches its own row.

Acceptance Criteria

  • The repro above gives the Expected result at 1440 and 768, in light and dark.
  • A regression test pins the behaviour (unit or Playwright, whichever tier can observe it).
  • No new raw-palette classes or hand-rolled primitives are introduced by the fix (docs/memory/design-system-contract.md).

Technical Notes

Evidence screenshots (kept on the machine that ran the sweep; the evidence folder is gitignored because the repository is public):

  • docs/testing/ui-sweep/evidence/2026-10-09-all/d4a6e8df-1.png

Found by /ui-sweep --all @ c90c711

Activity

  1. added
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 9, 2026
  2. added and removed
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 9, 2026
  3. added
    status-in-devMerged to dev, awaiting release cut to main
    and removed on Oct 9, 2026
  4. removed
    status-in-devMerged to dev, awaiting release cut to main
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions