Repository navigation
Conversation
On a fresh login the routes were generated as soon as listApis returned, without waiting for listZones. The zones in the store were still the initial value, an object, so the menu checks that call zones.filter() failed and the UI stayed empty until a reload. Start with an empty list and generate the routes only after the zones are stored. Fixes: apache#14847
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #14920 +/- ##
=============================================
- Coverage 20.80% 3.86% -16.95%
=============================================
Files 6053 494 -5559
Lines 548466 42888 -505578
Branches 73283 8141 -65142
=============================================
- Hits 114129 1657 -112472
+ Misses 420977 40999 -379978
+ Partials 13360 232 -13128
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Fixes: #14847
On a fresh login
GetInfostartslistZonesandlistApisin parallel and generates the routes as soon aslistApis(and the capabilities) return. IflistZoneshas not returned yet, the zones in the store are still the initial value{}, and the menu checks that callstore.getters.zones.filter(...)throwzones.filter is not a function. The UI stays empty until a reload, when the zones come from local storage.This PR:
zonesstate as an empty list, the same type thatSET_ZONESand the cached value useTypes of changes
Bug Severity
How Has This Been Tested?
In a browser, with the UI dev server (
npm run serve) pointed at a 4.22.1.1 management server, logging in as a user whose role is of type User with a short allow-list (listApis,listZones,listSecurityGroups,listUsers,listCapabilities,listLdapConfigurations,listNetworkServiceProviders,cloudianIsEnabled,listNetworks,listVPCs, then*deny). Local storage and cookies were cleared before each login.The race is timing dependent, so to make it certain the
listZonesrequest was held back for 4 seconds in the browser.TypeError: store.getters.zones.filter is not a functionatnetwork.jsfromGenerateRoutes, as in the issue.vue-cli-service lintreports no errors for the changed file.