fix: [M3-10679] - NodeBalancer Configuration form unresponsiveness for larger VPC deployments#12991
Conversation
| const linodeIPQueries = useQueries({ | ||
| queries: | ||
| linodesData?.map<UseQueryOptions<LinodeIPsResponse, APIError[]>>( | ||
| ({ id }) => ({ | ||
| ...linodeQueries.linode(id)._ctx.ips, | ||
| enabled: isSubnetSelected, | ||
| }) | ||
| ) ?? [], | ||
| }); |
There was a problem hiding this comment.
This was the problematic code causing performance issues. The code itself is fine, but isn't scaling well for customers that have hundres of Linodes.
I was able to remove this and use useVPCIPsQuery (/v4beta/vpcs/:id/ips) instead
| const { | ||
| data: subnetsData, | ||
| error: subnetsError, | ||
| isLoading: subnetsIsLoading, | ||
| } = useSubnetsQuery(Number(vpcId), {}, {}, isSubnetSelected); |
There was a problem hiding this comment.
This is not the primary fix but...
Using useSubnetsQuery here would cause bugs for VPCs with more than 100 subnets (100 is the default API page size). useSubnetsQuery is paginated but getVPCIPOptions expects all subnets to be passed.
I removed useSubnetsQuery and replaced it with useVPCQuery which includes a subnets field, which includes all subnets in the VPC. This will eliminate the possibility of bugs for VPCs with more than 100 subnets .
| disabled={disabled} | ||
| errorGroup={`${configIdx}`} | ||
| errorText={nodesErrorMap.port} | ||
| inputId={`node-port-${configIdx}-${idx}`} |
There was a problem hiding this comment.
Added inputIds to fix this issue:
Screen.Recording.2025-10-15.at.4.24.55.PM.mov
| }, | ||
| queryKey: null, | ||
| }, | ||
| vpcIps: (vpcId: number, filter: Filter = {}) => ({ |
There was a problem hiding this comment.
We don't need vpcId duplicated here. vpcId is already in scope
| }); | ||
| } | ||
|
|
||
| return options.sort((a, b) => a.label.localeCompare(b.label)); |
… larger VPC deployments
abailly-akamai
left a comment
There was a problem hiding this comment.
Nice thanks for the fixes - they all make sense to me.
While not being able to fully test it, did not notice any regressions
dwiley-akamai
left a comment
There was a problem hiding this comment.
Code review ✅
No regressions observed ✅
/v4/linode/instaces/:id/ips --> /v4beta/vpcs/:id/ips swap verified ✅
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Cloud Manager UI test results🔺 5 failing tests on test run #6 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/objectStorage/access-key.e2e.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts,cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts" |
|||||||||||||||||||||||||||||
…r larger VPC deployments (linode#12991) * use vpc ips endpoint (work in progress) * improve things more * clean up * fix typecheck * other bug fixes * Added changeset: NodeBalancer Configuration form unresponsiveness for larger VPC deployments * update cypress tests * make code a bit safer * Apply suggestion from @dwiley-akamai Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com> * Apply suggestion from @dwiley-akamai Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com> --------- Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>


Description 📝
This PR fix unresponsiveness on the NodeBalancer configurations page for larger NodeBalancer + VPC deployments but also includes some other fixes too.
Fixes 🔧
Scope 🚢
Upon production release, changes in this PR will be visible to:
Preview 📷
/v4/linode/instaces/:id/ips. This was resulting in +400 requests to the API at once for a customer/v4beta/vpcs/:id/ipsHow to test 🧪
Prerequisites
Reproduction steps
To replicate the performance issues, you need a large account, but you can still test this PR with any size account to ensure Cloud Manager still works as expected.
Verification steps
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅