fix: make 0218 event_routes migration idempotent#956
Closed
dylanjeffers wants to merge 3 commits into
Closed
Conversation
…et auth The handler was using getAuthedWallet(c) which required signature-based auth, then updating by wallet address. This was overcomplicated for a fire-and-forget activity signal. Now uses myId from the user_id query param (already decoded by resolveMyIdMiddleware) and updates by user_id. Removes requireAuthMiddleware from the route since the handler no longer needs the wallet — the global authMiddleware still validates signatures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers the three key paths: - Authenticated request with valid user_id returns 200 - Missing user_id returns 400 - Unauthenticated request with user_id returns 403 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CREATE TABLE IF NOT EXISTS silently skips if the table already exists, but the subsequent ALTER TABLE ADD CONSTRAINT had no guard — causing: ERROR: multiple primary keys for table "event_routes" are not allowed on any DB where the table was already created. Fix by inlining the PRIMARY KEY constraint in the CREATE TABLE definition so the whole statement is skipped under IF NOT EXISTS. This has been blocking bridge auto-upgrades since the 0218 migration was first applied to production (June 9). All migrate-* jobs in the api namespace have been failing, leaving 60+ auto-upgrader CronJob pods stuck in a 30-min kubectl-wait loop.
Contributor
Author
|
Re-opening against main with cherry-pick to isolate only the migration fix — dropping ping feature code that was carried along from the branch tip. |
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.
The ALTER TABLE ADD CONSTRAINT was not guarded, causing bridge migrate to fail when the table already exists. Inlines PRIMARY KEY into CREATE TABLE IF NOT EXISTS so re-runs are safe. This was blocking all auto-upgrades since June 10.