nabassa1323 commented on code in PR #14399:
URL: https://github.com/apache/cloudstack/pull/14399#discussion_r4293199048


##########
ui/src/views/network/CreateIsolatedNetworkForm.vue:
##########
@@ -566,24 +574,30 @@ export default {
       if (!isAdmin()) { // normal user is not aware of the VLANs in the 
system, so normal user is not allowed to create network with network offerings 
whose specifyvlan = true
         params.specifyvlan = false
       }
-      if (forVpc !== null) {
+      if (forVpc !== undefined && forVpc !== null) {
         params.forvpc = forVpc
       }
       this.networkOfferings = []
       this.selectedNetworkOffering = {}
       getAPI('listNetworkOfferings', params).then(json => {
-        this.networkOfferings = 
json.listnetworkofferingsresponse.networkoffering || []
-        this.networkOfferings = this.networkOfferings.filter(offering => 
offering.fornsx === this.selectedZone.isnsxenabled)
-        if (!this.selectedZone.routedmodeenabled) {
+        const offerings = json?.listnetworkofferingsresponse?.networkoffering 
|| []

Review Comment:
   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
   
   1. Add Network → Isolated (all Isolated network offerings disabled)
   2. Toast: Request failed. (no HTTP status)
   3. Network tab: listNetworkOfferings → HTTP 200
   4. Response:
   { "listnetworkofferingsresponse": {} }
   5. Console:
   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:
   
   - shows a clear warning on Isolated when no offerings are available (instead 
of only failing silently / with a toast)
   - hardens L2 the same way (|| [] / safe parse) — #13503 only touched Isolated
   - adds a catch on listVPCs so a VPC lookup failure does not break the 
offerings path
   - documents that the empty-response crash is also triggered by disabled 
offerings, not only physical-network tags
   
   I’m happy to slim this PR to the L2 / warning / listVPCs parts, or close 
whatever is redundant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to