Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR replaces the inline single-step cancellation form with a deliberate two-step panel (confirm gate + optional feedback), adds a calm Key changes:
Confidence Score: 4/5Safe to merge; one targeted fix to the E2E seed type/guard would harden CI diagnostics but does not block the primary user path All three prior review threads are fully resolved. The core cancellation flow, follow-up page, redirect logic, and convex tier-matching changes are clean and well-covered by unit, visual, and smoke tests. The one remaining concrete issue is a type/guard gap in the E2E seed helper ("skipped" status not checked) that would produce a slow timeout rather than a fast-fail in an edge case — it does not affect production behavior. apps/web/e2e/convexTestData.ts — the ProviderEventProcessingResult type and the seed's processing-result guard should be updated to cover the new "skipped" status emitted by providerEventProcessing.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Member
participant BillingPage as /subscribe/account
participant Panel as CancellationPanel
participant API as /api/subscribe/billing/cancel
participant CanceledPage as /subscribe/account/canceled
Member->>BillingPage: Load page
BillingPage-->>Member: Show "Stop future renewals" button
Member->>Panel: Click "Stop future renewals"
Panel-->>Member: Show confirmation panel (submit disabled)
Member->>Panel: Check confirmation checkbox
Panel-->>Member: Submit button enabled
Member->>Panel: Click "Confirm cancellation"
Panel->>API: POST billingSubscriptionId, tierName, currentPeriodEnd, reason
API-->>API: resolveMemberBillingCancelRedirect()
API-->>CanceledPage: 303 redirect → /subscribe/account/canceled?guildId=&subscription=&tier=&until=
CanceledPage->>CanceledPage: requireBillingSession() or redirect /subscribe/connect
CanceledPage->>CanceledPage: Correct guildId mismatch if needed (preserve all params)
CanceledPage->>CanceledPage: loadSubscriptions() + loadSupportHref()
CanceledPage-->>Member: Show "Future renewals are off" + access-end copy + links
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/web/e2e/convexTestData.ts
Line: 55-60
Comment:
**`"skipped"` status missing from local type union**
`ProviderEventProcessingResult` only lists `"processed" | "failed"`, but the updated `providerEventProcessing.ts` can now emit a third status — `"skipped"` — when all matching tiers are archived or deleted. Because the seed guard only checks `status === "failed"`, a skipped seed event slips through silently: the early-exit never fires and the polling loop burns through its 120 attempts before surfacing a generic timeout error, which is much harder to diagnose than an immediate throw.
```suggestion
type ProviderEventProcessingResult = {
providerEventId: string;
status: "processed" | "failed" | "skipped";
reason?: string;
};
```
You'd also want to extend the guard to cover the new status so the seed fails fast if skipped:
```typescript
if (currentEventResult?.status === "failed" || currentEventResult?.status === "skipped") {
throw new Error(
`Unable to process recurring billing seed for ${args.discordUserId}: ${JSON.stringify(currentEventResult)}`,
);
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (18): Last reviewed commit: "Probe billing seed ownership fallbacks" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 016189d5d6
ℹ️ 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".
|
@perkcord preview |
Manual Vercel PreviewTriggered from PR comment for branch Use |
Snapshot Preview6 changed snapshot file(s) in this PR. Storybook snapshotsNo changed snapshots. Playwright visual snapshots (6)
|
|
Reviewed the snapshot preview from https://github.com/BASIC-BIT/perkcord/actions/runs/23600188630. The three changed Playwright snapshots line up with the intended UI changes in this PR: the revealed cancel panel plus the new canceled follow-up viewport/full-page states. No code change needed for this bot comment. |
|
Investigated the failing |
|
Investigated the failing |
|
Investigated the latest failing job from https://github.com/BASIC-BIT/perkcord/actions/runs/23601130295/job/68731177135. The failure was the cancellation smoke test timing out at 30s before the follow-up page assertions. The most likely bottleneck is , which polls Convex billing state and can legitimately take longer after the recent account-session/main-branch changes. I raised that single test's timeout to 90s in , then reran local gates through the push hook (, , , and all unit suites for web/bot/convex), and pushed fix commit . |
|
Investigated the latest failing |
Use the public Discord account-link REST endpoint in Playwright billing seeding so CI cloud runs can attach account ownership before billing lookups.
There was a problem hiding this comment.
Pull request overview
Redesigns the manage-billing cancellation experience to be more deliberate (two-step UI + explicit confirmation) and redirects successful cancellations to a dedicated follow-up page, with added unit/smoke/visual coverage.
Changes:
- Replaced inline cancellation textarea with a two-step cancellation panel and confirmation checkbox.
- Redirected cancellation success to
/subscribe/account/canceledfollow-up page with access-end messaging and support links. - Added Vitest + Playwright smoke/visual coverage for the updated flow, plus related support utilities.
Reviewed changes
Copilot reviewed 16 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/agentic/agentic-improvement-log.md | Logs new Playwright coverage for the cancellation redesign. |
| apps/web/lib/useDebounce.test.ts | Adds unit tests for useDebounce. |
| apps/web/lib/purchaseTypeLabel.test.ts | Adds unit tests for purchase type/entitlement policy labels. |
| apps/web/lib/billingSession.ts | Introduces a helper to require a billing session or redirect. |
| apps/web/lib/api/subscribe/billing.ts | Adds generalized redirect builder + follow-up redirect + timestamp parsing for cancel redirect. |
| apps/web/lib/api/subscribe/billing.test.ts | Updates tests to assert new follow-up redirect behavior and params. |
| apps/web/lib/accountBilling.ts | Renames cancelability helper and adds support-link resolution utility. |
| apps/web/lib/accountBilling.test.ts | Updates tests for renamed helper and adds coverage for support-link resolution. |
| apps/web/e2e/visual.spec.ts | Updates “Account” heading expectation and snapshots the new cancellation panel + follow-up page. |
| apps/web/e2e/smoke.spec.ts | Adds smoke coverage asserting deliberate cancellation gating and follow-up page links. |
| apps/web/e2e/convexTestData.ts | Extends seed helper to link discord account + process provider events for recurring billing seed. |
| apps/web/app/subscribe/account/page.tsx | Renames page/title to “Manage billing”, uses requireBillingSession, removes inline success banner. |
| apps/web/app/subscribe/account/canceled/page.tsx | Adds dedicated follow-up page that loads subscription info and shows next steps. |
| apps/web/app/subscribe/account/billing-subscription-card.tsx | Swaps inline form for new cancellation panel component. |
| apps/web/app/subscribe/account/billing-subscription-cancellation-panel.tsx | Adds the new two-step cancellation panel UI. |
| apps/web/app/subscribe/account/billing-subscription-cancellation-panel.test.tsx | Adds unit tests for reveal state + confirmation gating. |
| .github/workflows/convex-backup-export.yml | Removes trailing whitespace in step summary output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BASIC-BIT
left a comment
There was a problem hiding this comment.
Addressed the valid Copilot feedback locally: removed the extra provider-event processing pass from the recurring billing seed, scoped the seeded provider event to the matched guild to avoid unrelated historical failures, switched the smoke timeout to testInfo.setTimeout, guarded redirect helpers against external paths, clamped the canceled-page fallback tier param, extracted canceled-page copy/timestamp helpers with focused tests, and tightened requireBillingSession typing so the account pages no longer need casts.
|
Addressed the remaining valid follow-up items locally before the next push: the canceled-page fallback copy no longer promises a support link when that button may be absent, and the provider-event matcher now ignores deleted tiers when resolving price ids so stale tier rows do not break the recurring-billing smoke seed in CI. I reran the focused web helper test, web typecheck, and the Convex provider-event test suite locally. |
|
Investigated the fresh failing |
|
Investigated the next failing |






Summary
Closes #242