0.17.1: /api/v1/events answers again on a database that predates concerts - #129
Merged
Merged
Conversation
…erts nixamp.com had live_events from before 0.17.0. The schema in live-events.ts built the index on kind before the ALTER TABLE that adds kind to an existing table, so the whole statement failed with "column kind does not exist", the store cached that rejected promise, and every /api/v1/events request answered 500 "the live event service failed" until the process restarted. A fresh database (tests, CI) creates the table with kind already and never saw it. - the ADD COLUMN statements now run before the kind index - a failed schema run is retried on the next request instead of remembered - the 500 path logs the underlying error - a test pins the statement order and the retry - 0.17.1 in package.json, desktop and web Verified by running the fixed schema against the production database in a rolled-back transaction. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QuUkTrofSjQ15j79mRuy4f
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.
What
GET https://nixamp.com/api/v1/events(and?kind=concert) has answered 500the live event service failedsince 0.17.0 went live.Why
nixamp.com's
live_eventstable predates #125. The schema insrc/live-events.tscreated thelive_events_kindindex before theALTER TABLE ... ADD COLUMN IF NOT EXISTS kindthat brings an existing table forward, so on production the whole multi-statement schema failed withcolumn "kind" does not exist.ensure()then cached the rejected promise, so every later request failed too. A fresh database (tests, CI) creates the table withkindin place and never hits it.Fix
kindpackage.json,desktop/package.json,web/package.jsonVerified
bun run typecheck,bun test test web/test(623 pass, 1 skip),bun run pack:cli; the tarball runs under plain node (--version= 0.17.1) and importsoauth-server,oauth-api,tickets,watch-party,live-events,live-api🤖 Generated with Claude Code
https://claude.ai/code/session_01QuUkTrofSjQ15j79mRuy4f