Demo seed: every played session fails to load ("This session could not be loaded") #978

Closed
opened 2026-09-30 17:13:37 +00:00 by claude-bot · 2 comments
Collaborator

Found by the owner while reviewing on dev (2026-09-30): opening any played session of the seeded campaign shows "This session could not be loaded — Something went wrong on our side".

Cause. GET /api/sessions/{id} returns a 500 from a pydantic ValidationError in SessionResponse: canonical_names.N — Input should be a valid dictionary or instance of SessionCanonicalName, with input 'Ossian Vale', 'Bastian Crowe', and so on. The demo seed (demo/engine.py, since #821) sets each played session's canonical_names to the names of the characters present. That field holds the name generator's picks ({category, prompt, selected_name, options, updated_at}), not who was there. The schema has required objects since v1 of the name generator (4c7440dc), so these sessions never loaded.

On dev, 42 of 91 sessions have string-only canonical_names; the 4 with objects are real generator picks.

Fix.

  • The seed writes canonical_names=[].
  • A new test in tests/test_demo_seed.py builds every seeded session's response as its GM and as a player. It fails on this bug without the fix.
  • Dev's existing rows get a one-off data fix: string-only lists are set to [].
Found by the owner while reviewing on dev (2026-09-30): opening any played session of the seeded campaign shows "This session could not be loaded — Something went wrong on our side". **Cause.** `GET /api/sessions/{id}` returns a 500 from a `pydantic` `ValidationError` in `SessionResponse`: `canonical_names.N — Input should be a valid dictionary or instance of SessionCanonicalName`, with input `'Ossian Vale'`, `'Bastian Crowe'`, and so on. The demo seed (`demo/engine.py`, since #821) sets each played session's `canonical_names` to the names of the characters present. That field holds the name generator's picks (`{category, prompt, selected_name, options, updated_at}`), not who was there. The schema has required objects since v1 of the name generator (4c7440dc), so these sessions never loaded. On dev, 42 of 91 sessions have string-only `canonical_names`; the 4 with objects are real generator picks. **Fix.** - The seed writes `canonical_names=[]`. - A new test in `tests/test_demo_seed.py` builds every seeded session's response as its GM and as a player. It fails on this bug without the fix. - Dev's existing rows get a one-off data fix: string-only lists are set to `[]`.
Author
Collaborator

Dev is fixed in place (owner-approved). 42 sessions with string-only canonical_names were set to []. A read-only check in the dev backend then built the response for all 91 sessions as GM and as player with 0 failures, including a8ed16b1 (The Tide-Gate) from the report.

The code fix (seed plus test) is in the linked PR; this issue closes when it merges.

Dev is fixed in place (owner-approved). 42 sessions with string-only `canonical_names` were set to `[]`. A read-only check in the dev backend then built the response for all 91 sessions as GM and as player with 0 failures, including a8ed16b1 (The Tide-Gate) from the report. The code fix (seed plus test) is in the linked PR; this issue closes when it merges.
Author
Collaborator

Fixed by PR #979 (merged 2026-09-30). The demo seed no longer writes character names into sessions.canonical_names, and a test covers every seeded played session loading. Dev's 42 affected rows were already corrected with the owner's OK, and all 91 dev sessions load. The earlier red CI on #979 was runner trouble (postgres DNS, vitest timeouts in untouched files), and the re-run was green.

Fixed by PR #979 (merged 2026-09-30). The demo seed no longer writes character names into `sessions.canonical_names`, and a test covers every seeded played session loading. Dev's 42 affected rows were already corrected with the owner's OK, and all 91 dev sessions load. The earlier red CI on #979 was runner trouble (postgres DNS, vitest timeouts in untouched files), and the re-run was green.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#978
No description provided.