Fixed the frontend subscription data not syncing with the backend#3051
Open
isaiahmartin847 wants to merge 7 commits intoInfisical:mainfrom
Open
Fixed the frontend subscription data not syncing with the backend#3051isaiahmartin847 wants to merge 7 commits intoInfisical:mainfrom
isaiahmartin847 wants to merge 7 commits intoInfisical:mainfrom
Conversation
added 2 commits
January 25, 2025 19:36
…n mount, keeping the server and frontend in sync.
maidul98
reviewed
Jan 28, 2025
frontend/src/context/SubscriptionContext/SubscriptionContext.tsx
Outdated
Show resolved
Hide resolved
added 5 commits
January 28, 2025 15:58
…iption fetch and added work comments.
Removed all the console logs and comments
akhilmhdh
approved these changes
Jan 31, 2025
Member
There was a problem hiding this comment.
Looking good to me. Approved! Good job @isaiahmartin847
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 snippetsIf you have any questions, please let me know. I would be happy to address them.