fix: CORS for all /app routes + fix CI migration out-of-order error#1837
Merged
WcaleNieWolny merged 1 commit intoMar 20, 2026
Merged
Conversation
OPTIONS preflight requests to /app/:id were returning 404 because CORS middleware was only applied to /demo and /store-metadata routes. The onboarding flow calls /app/:id from the browser, triggering a preflight that the server wasn't handling. Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
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.



Summary (AI generated)
useCorsmiddleware globally (*) to all/approutes instead of only/demoand/store-metadata--include-allflag tosupabase db pushin CI to handle out-of-order local migrationsMotivation (AI generated)
CORS fix: OPTIONS preflight requests to
/app/:idwere returning 404, blocking the onboarding flow. The browser sends a preflight OPTIONS before any cross-origin call, but CORS middleware was only set on/demoand/store-metadata— leaving all other routes unhandled.CI migration fix:
supabase db pushwas failing with:Migration
20260317020500_revoke_cleanup_expired_demo_apps_public_exec.sqlwas committed out-of-order and never applied to the remote DB. Its timestamp is earlier than the last applied remote migration, so the normaldb pushrejects it. The--include-allflag is the correct way to handle this scenario — it applies all unapplied local migrations regardless of timestamp order.Business Impact (AI generated)
Test Plan (AI generated)
bun run supabase:start) and backend (bun backend)OPTIONS /app/:id— expect200with CORS headers instead of404bun test:backendGenerated with AI