From 2350abcb28606baf120b41b0c2949c9bc01e94dc Mon Sep 17 00:00:00 2001 From: batzionb Date: Sun, 2 Aug 2026 22:59:10 +0300 Subject: [PATCH] fix: seed compute instance cache with correct response shape after create After creating a VM, VmCreatePage seeded the query cache with the bare ComputeInstance returned by the create mutation, but useComputeInstance's select() expects the GetComputeInstanceResponse shape ({ object }) that client.get() actually returns. The mismatch made the freshly-seeded cache read as undefined, so the details page briefly rendered "Virtual machine not found" until the mutation's background refetch replaced it with the correctly-shaped data a few seconds later. Assisted-by: Claude Code Signed-off-by: batzionb --- libs/ui-components/src/pages/tenant/VmCreatePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ui-components/src/pages/tenant/VmCreatePage.tsx b/libs/ui-components/src/pages/tenant/VmCreatePage.tsx index c2326310..3b9fde87 100644 --- a/libs/ui-components/src/pages/tenant/VmCreatePage.tsx +++ b/libs/ui-components/src/pages/tenant/VmCreatePage.tsx @@ -46,7 +46,7 @@ export const VmCreatePage = () => { if (!instance?.id) { throw new Error('Create response missing id'); } - qc.setQueryData(apiQueryKey('v1/compute_instances', [instance.id]), instance); + qc.setQueryData(apiQueryKey('v1/compute_instances', [instance.id]), { object: instance }); navigate(`/vms/${instance.id}`); }, [navigate, provisionVm, qc],