Summary
packages/api/src/lib/lifecycle/applyTransition.ts documents itself as "sequential, not transactional" because @neondatabase/serverless HTTP driver (via drizzle-orm/neon-http) does not support db.transaction(). A crash between insertReview and updateArtifactStatus could leave a stranded review row that bumps the count toward a future publish without flipping the artifact.
Requirements
Context
Flagged in the Plan 1 final review. At v1 admin write volumes the non-atomicity is acceptable; this issue gets more urgent as concurrent write volumes grow.
Implementation Notes
The Cloudflare Workers + neon-serverless integration requires nodejs_compat flag in wrangler.jsonc — verify before committing to the swap. Some HTTP-only Neon features may not be available via WebSocket.
Summary
packages/api/src/lib/lifecycle/applyTransition.tsdocuments itself as "sequential, not transactional" because@neondatabase/serverlessHTTP driver (viadrizzle-orm/neon-http) does not supportdb.transaction(). A crash betweeninsertReviewandupdateArtifactStatuscould leave a stranded review row that bumps the count toward a future publish without flipping the artifact.Requirements
createDb(packages/api/src/db/index.ts) fromneon-httptoneon-serverless(WebSocket Pool driver)applyTransitionbody indb.transaction(async tx => { ... })once Pool driver is in placeapplyTransition.tsto remove the TODOContext
Flagged in the Plan 1 final review. At v1 admin write volumes the non-atomicity is acceptable; this issue gets more urgent as concurrent write volumes grow.
Implementation Notes
The Cloudflare Workers + neon-serverless integration requires
nodejs_compatflag in wrangler.jsonc — verify before committing to the swap. Some HTTP-only Neon features may not be available via WebSocket.