Skip to content

fix(paycraft): production hardening — lifetime entitlement + billing observability + Next.js security - #114

Merged
Thejas775 merged 3 commits into
mainfrom
fix/paycraft-prod-hardening
Jul 13, 2026
Merged

fix(paycraft): production hardening — lifetime entitlement + billing observability + Next.js security#114
Thejas775 merged 3 commits into
mainfrom
fix/paycraft-prod-hardening

Conversation

@Thejas775

Copy link
Copy Markdown
Collaborator

Summary

Production-hardening for PayCraft. Deploying to main triggers deploy-cloud.yml (Vercel dashboard + Supabase edge functions).

Changes

  • Lifetime entitlement (Stripe): stripe-webhook now grants on mode=payment + async_payment_succeeded — one-time/lifetime purchases were silently dropped. Reuses the existing subscription-handler upsert path (same email/current_period_end columns as working subscriptions); ~100yr period for lifetime (matches UPI precedent; is_premium has no null-means-forever path).
  • Billing observability + tests: 3 silent catches in PayCraftBillingManager (transferToDevice / revokeCurrentDevice / applyPremiumResult) now log via PayCraftLogger.onError; +11 unit tests on the previously-untested 588-line core (all pass locally: premium/cache, logout reset, OAuth error, OTP decisioning, transfer abort).
  • Security: Next.js 14.2.15 → 14.2.35 (resolves the 2025-12-11 critical CVE); build clean (77 pages).

Verified locally

  • :cmp-paycraft:jvmTest CurrencyResolver 10/10 + BillingManager 11/11 pass
  • dashboard npm run build clean; local stack (Supabase + dashboard) smooth
  • Currency end-to-end proven across 5 locales via local /config

Review flags

  • Lifetime path treats every mode=payment checkout as lifetime (fine if payment-mode = lifetime-only).
  • Residual Next.js high advisories need a Next 15/16 migration (separate).
  • Device-token-write paths (incl. the applyPremiumResult premium branch) not unit-testable in commonTest — on-device only.

🤖 Generated with Claude Code

therajanmaurya and others added 2 commits July 3, 2026 18:08
#113)

tsconfig.tsbuildinfo (TS build cache), infra/deploy/.state/* (deploy phase
markers + last-promoted-sha), and infra/deploy/.deploy-ledger.jsonl are all
machine-local, auto-regenerated files that were committed before their
.gitignore patterns existed. git rm --cached untracks them (kept on disk);
adds .deploy-ledger.jsonl to infra/deploy/.gitignore. Stops per-machine churn.

Co-authored-by: Mobile Byte Labs <mobilebytelabs@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bservability, Next.js security

- stripe-webhook: grant entitlement on mode=payment + async_payment_succeeded
  (one-time/lifetime purchases were silently dropped); reuses subscription-handler
  upsert path (email/current_period_end), ~100yr period for lifetime.
- PayCraftBillingManager: replace 3 silent catches with PayCraftLogger.onError
  (transferToDevice, revokeCurrentDevice, applyPremiumResult); add 11 unit tests
  covering premium/cache application, logout reset, OAuth error, OTP decisioning,
  transfer abort guard.
- dashboard: bump Next.js 14.2.15 -> 14.2.35 (resolves the 2025-12-11 critical CVE).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pay-craft Error Error Jul 11, 2026 8:12am

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 447e40f2-94c8-45e1-841c-32a5d2469e6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/paycraft-prod-hardening

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
paycraft-docs 4442429 Jul 11 2026, 08:14 AM

…e-existing UI files)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Thejas775
Thejas775 merged commit 9373224 into main Jul 13, 2026
9 of 11 checks passed
@therajanmaurya
therajanmaurya deleted the fix/paycraft-prod-hardening branch July 29, 2026 12:28
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.

2 participants