Skip to content
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 validto computed property infinite calls problem #2941

Closed
wants to merge 1 commit into from

Conversation

murtaza-swati
Copy link
Collaborator

When subscription/v2-plan in DB has valid_to null, the /plan page make infinite calls to v_subscriptions and causing the page unresponsive.

The computed property is causing infinite calls because it depends on subscription.validTo, and within the computation, it makes a call to fetchV2Subscriptions.perform(), which likely modifies subscription.validTo. This causes the computed property to re-evaluate, leading to an infinite loop.

Fixed Approach with an Observer:
Ensure fetchV2Subscriptions doesn't modify subscription.validTo directly within the computed property, as this triggers recomputation.
Use computed properties for deriving state, and use observer to avoid side effect like fetching data.

@murtaza-swati
Copy link
Collaborator Author

closing in favour of #2942

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.

2 participants