Skip to content

fix(checkout): write the catalog episode row before the first order - #123

Merged
ralyodio merged 1 commit into
mainfrom
fix/coinpay-episode-row
Oct 21, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/coinpay-episode-row

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Live test of #122 failed: `order_items_episode_id_episodes_id_fk`. Prod `episodes` is empty (nothing seeds it), so no order could be created, and the order row was left behind without its item.

  • `createOrder` upserts the catalog episode row (`on conflict do nothing`), then writes order + item in one transaction.

Tests: api 30/30, typecheck clean.

🤖 Generated with Claude Code

order_items and entitlements reference episodes(id) and nothing seeds that
table, so every checkout failed with order_items_episode_id_episodes_id_fk
and left an orphan order behind. createOrder now upserts the catalog's
episode row and writes the order and its item in one transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit eb45dfd into main Oct 21, 2026
5 checks passed
@ralyodio
ralyodio deleted the fix/coinpay-episode-row branch October 21, 2026 12:14
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

1 finding(s)

MEDIUM: 1

Severity Rule Location
MEDIUM js-unescaped-html-sink apps/site/app/_components/pit-footer.tsx:17

Snippets are redacted; ThreatCrush never prints matched credential material.

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