-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: reload available features upgraded #29161
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances feature availability synchronization after billing changes in PostHog. Here's a concise summary of the key changes:
- Added
update_available_product_features
method inbilling_manager.py
to fetch and update organization features from billing service - Integrated feature reloading in
billingLogic.tsx
by callingloadCurrentOrganization
after billing upgrades - Added automatic feature refresh after trial activation/cancellation in billing manager
- Removed unused
plan_keys
parameter fromget_billing
method for cleaner code
The changes ensure that users immediately see their updated feature access after any billing-related changes without requiring a page refresh.
2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +332 B (0%) Total Size: 9.72 MB ℹ️ View Unchanged
|
billing_manager = self.get_billing_manager() | ||
query = {} | ||
if "include_forecasting" in request.query_params: | ||
query["include_forecasting"] = request.query_params.get("include_forecasting") | ||
response = billing_manager.get_billing(org, plan_keys, query) | ||
response = billing_manager.get_billing(org, query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up of unused arg
Changes
Following up on https://github.com/PostHog/billing/pull/1121.
After a user upgrades, this is meant to make sure the latest available features are loaded.
Paths for when they need to be reloaded
This PR handles all of the above. There is much room to improve here how we sync avail features to organizations but this is a big improvement to the UX because right now the proper features are not loaded in until you refresh.
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?