Skip to content

0.17.1: /api/v1/events answers again on a database that predates concerts - #129

Merged
ralyodio merged 1 commit into
mainfrom
chore/release-0.17.1
Sep 12, 2026
Merged

ralyodio merged 1 commit into
mainfrom
chore/release-0.17.1

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

GET https://nixamp.com/api/v1/events (and ?kind=concert) has answered 500 the live event service failed since 0.17.0 went live.

Why

nixamp.com's live_events table predates #125. The schema in src/live-events.ts created the live_events_kind index before the ALTER TABLE ... ADD COLUMN IF NOT EXISTS kind that brings an existing table forward, so on production the whole multi-statement schema failed with column "kind" does not exist. ensure() then cached the rejected promise, so every later request failed too. A fresh database (tests, CI) creates the table with kind in place and never hits it.

Fix

  • ADD COLUMN statements run before the index on kind
  • a failed schema run is retried on the next request instead of remembered for the life of the process
  • the 500 handler now logs the underlying error (it was silent)
  • a test pins the statement order and the retry
  • version 0.17.1 in package.json, desktop/package.json, web/package.json

Verified

  • 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 imports oauth-server, oauth-api, tickets, watch-party, live-events, live-api
  • the fixed schema was run against the production database inside a rolled-back transaction: it applies, and all six new columns appear

🤖 Generated with Claude Code

https://claude.ai/code/session_01QuUkTrofSjQ15j79mRuy4f

…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
@ralyodio
ralyodio merged commit 86f57b3 into main Sep 12, 2026
2 checks passed
@ralyodio
ralyodio deleted the chore/release-0.17.1 branch September 12, 2026 11:54
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