Skip to content

Fix billing downgrade recharge and suspension race#2397

Draft
niemyjski wants to merge 2 commits into
mainfrom
issue/billing-downgrade-race
Draft

Fix billing downgrade recharge and suspension race#2397
niemyjski wants to merge 2 commits into
mainfrom
issue/billing-downgrade-race

Conversation

@niemyjski

Copy link
Copy Markdown
Member

Summary

  • Prorate and finalize paid-to-free cancellations so unused yearly time becomes customer credit before a later re-upgrade.
  • Serialize plan changes and subscription webhooks per organization, and ignore stale or free-plan cancellation events.
  • Centralize system IDs while preserving existing public compatibility aliases.
  • Add signed local endpoint coverage for event ordering, stale/current subscriptions, concurrent changes, and reactivation.

Root cause

Paid-to-free changes immediately canceled the subscription without proration. A later upgrade therefore created a new full-price subscription. Asynchronous deletion webhooks could also overwrite the free or newly paid state because billing updates were neither serialized nor correlated to the current subscription.

Verification

  • dotnet build Exceptionless.slnx -m:1 — 0 warnings, 0 errors
  • BillingLifecycleEndpointTests — 11 passed
  • OrganizationEndpointTests — 84 passed
  • Full backend suite — 2,510 passed, 0 failed, 2 intentional skips
  • Merged-head localhost Aspire dogfood — API and Svelte health returned HTTP 200
  • Local-only Stripe boundary — no Stripe API traffic, Stripe.js, real/test keys, or production URLs
  • Thermonuclear merged-head review — no remaining race, compatibility, merge, or code-quality blocker

Breaking changes

None.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Core 73% 65% 9509
Exceptionless.AppHost 38% 40% 139
Exceptionless.Insulation 23% 23% 205
Exceptionless.Web 84% 67% 6900
Summary 77% (22593 / 29475) 65% (10366 / 15836) 16753

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