NO-ISSUE: seed compute instance cache with correct response shape after create - #113
Conversation
…eate
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 <noreply@anthropic.com>
Signed-off-by: batzionb <brotman@redhat.com>
WalkthroughChangesVM creation cache
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@batzionb: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: batzionb, ElayAharoni The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
VmCreatePageseeded the query cache with the bareComputeInstancefrom the create mutation, butuseComputeInstance'sselect()expects theGetComputeInstanceResponseshape ({ object }) thatclient.get()actually returns. The shape mismatch made the freshly-seeded cache entry resolve toundefined, tripping the details page's!vm"not found" branch until the mutation's background refetch replaced it with correctly-shaped data.{ object: instance }instead of the bareinstance.Test plan
tsc -b tsconfig.build.jsonpassespnpm --filter @osac/app-frontend run test— 453 tests passapps/playwrightharness (create VM → details page loads directly, no "not found" flash)Before
1-bug-vm-not-found-flash.webm
After
2-fix-vm-loads-directly.webm
🤖 Generated with Claude Code
Summary by CodeRabbit