Skip to content

Harden billing and generation workflow#33

Merged
Abdulmuiz44 merged 1 commit into
mainfrom
codex/product-hardening-and-generation-polish
May 1, 2026
Merged

Harden billing and generation workflow#33
Abdulmuiz44 merged 1 commit into
mainfrom
codex/product-hardening-and-generation-polish

Conversation

@Abdulmuiz44
Copy link
Copy Markdown
Collaborator

Summary

  • validate Lemon Squeezy checkout setup and add atomic credit transaction tracking
  • add Mistral image validation, retries, fallback telemetry, and failed-generation credit refunds
  • improve asset rerender UX, landing samples, and LaunchPix branding
  • force dynamic rendering for auth-backed routes to keep production builds stable

Verification

  • npm run typecheck
  • npm run build
  • npx supabase db push --linked

@netlify
Copy link
Copy Markdown

netlify Bot commented May 1, 2026

Deploy Preview for launchpix ready!

Name Link
🔨 Latest commit e25e595
🔍 Latest deploy log https://app.netlify.com/projects/launchpix/deploys/69f42bb1ee5fa000071cfd40
😎 Deploy Preview https://deploy-preview-33--launchpix.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Abdulmuiz44 Abdulmuiz44 merged commit c6d7180 into main May 1, 2026
4 of 5 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e25e595e20

ℹ️ 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".

)
returns boolean
language plpgsql
security definer
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Restrict execution of grant_credit_pack_atomic

This function is declared security definer and takes caller-controlled p_user_id/p_credits, but the migration does not enforce any caller check or lock down EXECUTE privileges. In a Supabase setup where public RPCs are reachable, an authenticated user can call this function directly (with fresh p_provider_reference values) to grant arbitrary credits without a real payment event, bypassing the webhook path entirely.

Useful? React with 👍 / 👎.

last_payment_at: new Date().toISOString()
})
.eq("id", current.id);
.update({ credits_remaining: current.credits_remaining + 1 })
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make refund credit update atomic

The refund path writes credits_remaining from a stale in-memory value (current.credits_remaining + 1) instead of incrementing in-database. If another balance mutation happens between the read and this update (for example, a concurrent refund or a webhook credit grant), this update can overwrite the newer total and lose purchased/refunded credits. The refund should use an atomic increment strategy rather than read-modify-write from application code.

Useful? React with 👍 / 👎.

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