Add fake payment lifecycle API - #25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e83051cf05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { createDatabase } from "lib/db/db-client" | ||
| import type { Middleware } from "winterspec" | ||
|
|
||
| const defaultDb = createDatabase() |
There was a problem hiding this comment.
Scope default DB instance per app context
Move DB initialization out of module scope: creating defaultDb once at import time makes all routes that rely on withDb share state across the entire process, so separate Winterspec bundles or test runs in the same process can see each other’s payments/things and become order-dependent. This introduces cross-instance data bleed rather than just per-request persistence.
Useful? React with 👍 / 👎.
|
Hi @seveibar, just following up on this Algora claim for #1. I noticed the bounty issue is now closed, but my claim is still pending on Algora. Could you confirm whether PR #25 is still eligible for review/reward, or whether another implementation was selected? Happy to make any changes if there is still a path forward. Thanks. |
Summary
idempotency_keybody field orIdempotency-Keyheader/claim #1
Tests
npx bun test tests/routes/payments-default-middleware.test.ts tests/routes/payments.test.tsnpx bun testnpx bun run buildnpx tsc --noEmitnpx biome check README.md lib/db/schema.ts lib/db/db-client.ts lib/middleware/with-db.ts lib/payments/route-schemas.ts routes/payments tests/routes/payments.test.ts tests/routes/payments-default-middleware.test.tsgit diff --checkAI-assisted with Codex; I reviewed the diff and kept the PR scoped to the bounty API.