Fixed the frontend subscription data not syncing with the backend #3051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description 📣
Issue: #3034
This pull request addresses the bug mentioned in the issue, but it also resolves additional bugs that were previously unnoticed. Let me explain:
On the first load, the client fetches the subscription data. However, as you create new projects and navigate within the app, it never fetches the subscription data again. For example, if you created your last project under the free tier and added some secrets, then returned to the organization overview, you would still be able to open the dialog to create a new project—even if you had already hit your limit. This occurs because the front end becomes out of sync with the back end.
This fix also resolves a range of other unknown issues related to the subscription. For instance, consider a scenario where Admin1 and Admin2 are logged in simultaneously. If Admin2 adds the member limit to a project, Admin1 would still be able to open the "Add New Member" dialog, fill it out, and submit it—even though the back end recognizes that the project has reached its member limit. This would result in an error.
Type ✨
Tests 🛠️
# Here's some code block to paste some code snippets
If you have any questions, please let me know. I would be happy to address them.