Skip to content

fix(history): accept place ids when restoring a session - #21

Merged
tkgstrator merged 1 commit into
masterfrom
fix/history-place-id-hotfix
Sep 3, 2026
Merged

fix(history): accept place ids when restoring a session#21
tkgstrator merged 1 commit into
masterfrom
fix/history-place-id-hotfix

Conversation

@tkgstrator

Copy link
Copy Markdown
Contributor

Hotfix — production is broken for 17 of the 43 cases. Branched off master rather than
develop, which is holding unreviewed work.

What happens

Opening a case that has investigable places throws 「レスポンスの形が想定と違うよ〜」 before
the player can ask anything. Reported from a real play on 十七回忌の客.

The interrogation screen reads GET /api/sessions/:id/history the moment it mounts.
sessionHistorySchema.histories[].characterId allowed a uuid or the literal victim
but places carry an author-written local id (choba, garden), so the response fails to
parse and the screen goes down with it. Two sessions on production show it exactly: zero
messages, zero model calls. It never got past the first read.

The fix

One union, widened to the three kinds of subject that exist, reusing placeIdSchema from
db/scenario-definition.ts so there is one definition rather than a copy.

The comment above that union already described this failure — it was written when the body
became a second kind of subject. Adding a third did not reach it. The comment now says so,
and there are tests for all three plus a rejection.

Verification

The two production responses that were failing were replayed against the fixed schema and
both parse.

Test plan

  • bun run typecheck — clean
  • bun run lint — no errors
  • bun run test — 725 pass / 0 fail, including four new cases for the subject id union
  • the actual failing production payloads parse after the change
  • after deploy: open 十七回忌の客 and confirm the screen loads

After this

Needs back-merging into develop so the fix is not lost on the next release.

Opening a case with investigable places threw "the response is not the shape we
expected" before the player could ask anything. The interrogation screen reads
the history the moment it mounts, and the history's characterId only allowed a
uuid or the literal victim — places carry an author-written local id, so every
case holding one failed to parse and took the screen down with it.

That is 17 of the 43 cases now in production.

The comment above that union already warned about exactly this, having been
written when the body was added as a second kind of subject. Adding a third did
not reach it.

Found on 十七回忌の客: two sessions, no messages, no model calls — it never got
past the first read.

Co-Authored-By: Claude <noreply@anthropic.com>
@tkgstrator
tkgstrator merged commit dd5c04a into master Sep 3, 2026
10 checks passed
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.

1 participant