Skip to content

Comments

Fix account plan display issue#79

Merged
sergeychernyshev merged 6 commits intomainfrom
71-account-settings-page-displays-free-plan-for-pro-account
Feb 22, 2026
Merged

Fix account plan display issue#79
sergeychernyshev merged 6 commits intomainfrom
71-account-settings-page-displays-free-plan-for-pro-account

Conversation

@sergeychernyshev
Copy link
Member

@sergeychernyshev sergeychernyshev commented Feb 22, 2026

This PR fixes an issue where the account settings page could display the 'free' plan even for accounts on a 'pro' plan.

The root cause was that the account's plan field (used by the index and general info) and the billing state (used for plan details) were tracked separately and could get out of sync, especially when updated via the Admin API.

Changes:

  • Updated AccountDO to automatically synchronize the plan info field whenever the billing state changes.
  • Updated AccountDO.updateInfo to correctly update the billing state when the plan is manually overridden (e.g. from the Admin UI).
  • Updated handleMe in src/index.ts to include full billing info for better client-side data consistency.
  • Updated handleAccountDetails in src/index.ts to correctly sync both name and plan changes to the SystemDO index.
  • Added regression tests in test/billing.spec.ts, test/admin.spec.ts, and test/accountdo.spec.ts to ensure the plan and billing data remain consistent.

Closes #71

✨ Assisted by AI: Gemini

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 22, 2026

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 successful!
View logs
startup-api a323640 Feb 22 2026, 11:02 PM

@sergeychernyshev sergeychernyshev merged commit 745b46d into main Feb 22, 2026
2 checks passed
@sergeychernyshev sergeychernyshev deleted the 71-account-settings-page-displays-free-plan-for-pro-account branch February 22, 2026 23:06
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.

Account settings page displays free plan for pro account

1 participant