Replace QuotaUsageProvider with Pinia store + enhancements#22640
Draft
davelopez wants to merge 4 commits intogalaxyproject:devfrom
Draft
Replace QuotaUsageProvider with Pinia store + enhancements#22640davelopez wants to merge 4 commits intogalaxyproject:devfrom
davelopez wants to merge 4 commits intogalaxyproject:devfrom
Conversation
Removes the old quota source usage provider component and introduces a Pinia store to manage quota usage state and fetching logic across the application. Adopts the store pattern throughout all relevant components, replacing provider logic and updating all quota usage retrieval and reactivity to use the store. Centralizes state, simplifies usage, and makes quota usage handling more maintainable and testable. Updates tests and supporting files to mock or use the store as appropriate.
Improves consistency between user and quota usage data by having the user store trigger refreshes of the quota usage store after relevant user updates. Adds logic to detect when a user update should prompt a quota refresh and ensures both stores are updated atomically. Refactors user state management for clarity and correctness, adding methods for explicit user and quota syncing, and updating related helpers and test utilities to use new store methods.
Ensures the usage bar receives the correct embedded and compact values from parent props, enabling more flexible rendering configurations and improving consistency across usages.
Introduces logic to detect history size changes and only refresh user data when necessary, minimizing redundant API calls. Co-authored-by: Copilot <copilot@github.com>
Contributor
Author
|
The test_multiple_quota_sources_for_user failure seems legit. Investigating... |
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.
Removes the old provider pattern and uses a new
quotaUsageStoreto ensure quotas are properly reactive across the app. Also ensures the quota values are updated when a "likely quota change" event happens, such as when a history is updated (*), a cleanup operation is complete, or a quota refresh is requested.Also, it modernizes some components to composition API and Typescript on the way.
(*) After updating the history, there was a bug where the user was updated only in the legacy app and not in the user store, which caused the quota in the masthead to update only on a page refresh or log-out/in cycle. This is properly synced now.
Part of #22606 that can be isolated
How to test the changes?
License