Skip to content

retain paid plan until period end on cancellation#237

Merged
vernu merged 1 commit into
mainfrom
dev
Jun 18, 2026
Merged

retain paid plan until period end on cancellation#237
vernu merged 1 commit into
mainfrom
dev

Conversation

@vernu

@vernu vernu commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Polar's subscription.canceled signals a scheduled cancellation (access continues until the period end), while subscription.revoked is the event that should actually remove access. The webhook handler was downgrading immediately on cancel and never handled revoke, so a Pro user dropped to Free the moment they canceled instead of at their real period end.

  • cancelSubscription now records cancelAtPeriodEnd + currentPeriodEnd and keeps the subscription active instead of deactivating it
  • add revokeSubscription for the real downgrade, wired to the subscription.revoked event in the Polar webhook handler
  • add controller + service specs covering event dispatch and the record-vs-downgrade DB semantics
  • add jest moduleNameMapper so specs can resolve src/* path aliases

Polar's subscription.canceled signals a scheduled cancellation (access
continues until the period end), while subscription.revoked is the event
that should actually remove access. The webhook handler was downgrading
immediately on cancel and never handled revoke, so a Pro user dropped to
Free the moment they canceled instead of at their real period end.

- cancelSubscription now records cancelAtPeriodEnd + currentPeriodEnd and
  keeps the subscription active instead of deactivating it
- add revokeSubscription for the real downgrade, wired to the
  subscription.revoked event in the Polar webhook handler
- add controller + service specs covering event dispatch and the
  record-vs-downgrade DB semantics
- add jest moduleNameMapper so specs can resolve src/* path aliases

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vernu vernu self-assigned this Jun 18, 2026
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
textbee Ready Ready Preview, Comment Jun 18, 2026 6:04am

Request Review

@vernu vernu merged commit c200ec3 into main Jun 18, 2026
8 checks passed
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