Allow any audit quantity with every fifth free - #14
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e618ea2891
ℹ️ 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".
| if metadata.get("pricing_rule") != "every_fifth_free": | ||
| raise PermissionError("payment pricing rule is not recognized") |
There was a problem hiding this comment.
Continue accepting outstanding legacy checkout sessions
When this version is deployed while a Checkout Session created by the previous version is still open—or after payment but before its return is processed—the session contains pubskill_tier and repo_* metadata but no pricing_rule, so both /paid-info and /paid reject it here after the customer has paid. Retain the legacy tier verifier until all previously created sessions have expired or otherwise been redeemed.
Useful? React with 👍 / 👎.
| sessionStorage.setItem("pubskill_pending_repos", JSON.stringify(repoUrls)); | ||
| location.assign(result.checkout_url); |
There was a problem hiding this comment.
Let checkout proceed when session storage is unavailable
When browser storage is disabled or sessionStorage is over quota, setItem throws synchronously and the surrounding catch prevents location.assign from running, so the customer cannot reach the newly created Checkout Session. This is especially problematic because the added recovery flow is intended to support missing browser state; make persisting the pending list best-effort and redirect even if it fails.
Useful? React with 👍 / 👎.
| } catch (error) { | ||
| status.textContent = error.message; | ||
| return; | ||
| } |
There was a problem hiding this comment.
Fall back to recovery after stored repositories are rejected
When the tab contains a valid pending list from a different or abandoned checkout, submitPaid fails the repository digest check and this early return prevents the /paid-info recovery form from ever being shown. Because the storage key is not associated with a session ID, revisiting a paid return URL in that state leaves the customer stuck on the mismatch error; discard the stale entry and continue into the recovery path.
Useful? React with 👍 / 👎.
Replaces the fixed 1-or-5 audit tiers with arbitrary positive audit quantities while preserving the two-option decision surface.
The old fixed five-repository Stripe price and the old direct payment links have been deactivated; Checkout Sessions are now the only hosted payment path.