Repository navigation
ui: handle empty network offerings without Request failed (#14377) #14399
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -800,8 +800,10 @@ export default { | |
| this.handleNetworkOfferingChange(null) | ||
| this.networkOfferings = [] | ||
| getAPI('listNetworkOfferings', params).then(json => { | ||
| this.networkOfferings = json.listnetworkofferingsresponse.networkoffering || [] | ||
| const offerings = json?.listnetworkofferingsresponse?.networkoffering || [] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the shared tab already handles an empty list here in 4.22.1.0. which request fails on that tab in the browser network tab?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None. On Shared, listNetworkOfferings also returns HTTP 200 with an empty
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in 4.22.1.0 that line already falls back to an empty list and shows the shared warning. can you share the console error from the shared tab? it might be the isolated tab erroring when the dialog opens |
||
| this.networkOfferings = Array.isArray(offerings) ? offerings : [] | ||
| }).catch(error => { | ||
| this.networkOfferings = [] | ||
| this.$notifyError(error) | ||
| }).finally(() => { | ||
| this.networkOfferingLoading = false | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like #13503 already fixed the crash on the isolated tab for 4.22 and main. does it still show request failed on main without this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Damans227 for the review — I was not aware of #13503 when I opened #14377 and this PR.
Our report is on CloudStack 4.22.1.0. #13503 is targeted at the 4.22.2 milestone, so it was not something we had on our installed 4.22.1.0 packages when we hit the bug.
Isolated repro on 4.22.1.0
{ "listnetworkofferingsresponse": {} }
TypeError: can't access property "filter", t.networkOfferings is undefined
at fetchNetworkOfferingData (CreateIsolatedNetworkForm.vue:555)
Root cause
Same as #13485 / #13503: empty listnetworkofferingsresponse -> networkOfferings stays undefined -> TypeError on .filter -> UI shows "Request failed."
The difference is only the trigger: in our case it is disabling Isolated offerings, not physical-network tags.
Beyond the same || [] guard as #13503, this PR also:
I’m happy to slim this PR to the L2 / warning / listVPCs parts, or close whatever is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, that explains it. can we slim this to the isolated warning and the l2 change? the empty list crash itself is already fixed on 4.22 and main