"Return classified resource when store find hits page-cache guard" by Cody Jackson, fixes issue 19075. Reviewed 2026-11-24 with Pass B only. My first review asked for changes on dc7d453; Cody answered with 4fd33cb.
Preview: https://rancherpr19959r.mf-created-dashboard.ui.rancher.space/dashboard/, built from 4fd33cb, backend the mf Rancher (v2.16.0-head). Saving there really writes to mf.
| Run | What blocks | Result |
|---|---|---|
| 1, strict (dc7d453) | A test that does not guard the fix, and any page that ends up worse | Request changes |
| 2, less strict (4fd33cb), this one | Only something a user sees go wrong in normal use, or a fix that does not hold | Approve |
| 2, read with the strict rules of run 1 | As run 1. Comment 6 would be the one to settle | Request changes |
On the PR preview itself, with real data and nothing saved. Log in to Rancher there first. Every comment below links to its step, and each step links back here.
▶ What the PR changes (7 steps)▶ Review comments (9 steps)
check-cypress-buildfails on this line and on 623:Property 'terminationGracePeriodSeconds' does not exist.
Typed the cloned deployment fixtures so the Cypress TypeScript build passes.
Yes. On dc7d453 the check failed only on lines 612 and 623. On 4fd33cb it passes: the two clones are declared as any.
This test can pass without the fix. The push leaves the list before its
pagesize=100request goes out, and@delayedListis satisfied by thepagesize=1count requests. Nothing here checks that the guard was reached, andcheckVisible()also passes for a table with no rows.
Narrowed the list intercept to the paginated list request and waited for it to start before navigating, so the race reliably hits the guard. The final list check now asserts the deployment row itself is visible.
Yes. Now it holds: I replayed the new test step by step with its own delays (list 1.5 s, detail 3 s) in a browser.
| Replay | Result | Guard reached |
|---|---|---|
| This build, 5 runs | Passes 5 of 5 | 0 of 5 |
| Master (054adb2), 5 runs | Fails 5 of 5 | 5 of 5 |
Cody's answer is half right: on this build the guard is not reached (0 of 5), because leaving the list drops its page first. The test still proves the page renders, and it fails without the fix.
▶ Step: what the e2e test proves nowA page opened through the race renders, but it never updates. I changed a Deployment from 1 to 3 replicas elsewhere: 30 s later the page still says 1/1. The second click on + gets a 409 and in the edit form every Save gets a 409 where the normal page merges and saves.
Unmounting a paginated list now invalidates any in-flight page fetch so the detail page loads into the store and live-updates normally. When the guard still triggers, it prefers the cached store entry if present.
Yes on dc7d453. On 4fd33cb the same walk gives:
| Walk through the race | dc7d453 | 4fd33cb | Master |
|---|---|---|---|
| The page | Shows, frozen | Shows, 3 of 3 | Blank, 3 of 3 |
| Changed from outside to 3 replicas | Still 1 after 30 s | Shows 3, 3 of 3 | Blank |
| Three clicks on + | 409 on the second | 200, 200, 200, 3 of 3 | Blank |
| Edit, change elsewhere, Save | 409 every time | 409 then merged and 200, 3 of 3 | Blank |
Nit: if
opt.transient ||is removed from the new condition, all the tests still pass, because this case also flipshavePage.
Added the transient test without a page, plus coverage for preferring a store-backed entry on a guard hit and invalidating in-flight page fetches on unmount.
Yes, and it is fixed: with opt.transient || removed, the new test fails (1 failed, 23 passed).
Nit: the comment that explained why the guard exists is gone, and nothing here says it any more.
Restored the comment explaining why the guard skips caching when a list page lands mid-request.
Yes. The comment is back.
▶ Step: the test and the commentWhen the guard hits, find returns the store's entry if the landed page has it, and otherwise a model that is not in the store. Two places still get there.
The navigation guard runs loadCluster while Home is still mounted, so leaving Home comes too late to drop its page. Reproduced with both requests delayed, the cluster taken out of Home's answer (as for a cluster past the first page), and the Configurable Views extension blocked.
| Both requests delayed | This build | Master |
|---|---|---|
| Cluster not on Home's page | Cluster Dashboard blank, 3 of 3 | Back to Home, 3 of 3 |
| Same, with the Configurable Views extension loaded | Opens, 3 of 3 (the extension asks for the cluster again) | Back to Home, 3 of 3 |
| Cluster on Home's page | Opens, 3 of 3 | Back to Home, 3 of 3 |
| No delays, cluster not on Home's page | Opens, 3 of 3 | Opens, 3 of 3 |
It asks for its page after the nodes request, so a list left in between asks after it is gone, and nothing drops that answer.
| Nodes and Service delayed | This build | Master |
|---|---|---|
| Service not on the page (cut to 5 rows): updates? | Shows but never updates, 5 of 5 | Blank, 3 of 3 |
| Service on the page: updates? | Yes, 3 of 3 | - |
| No delays: guard reached? | No, 0 of 3 | - |
In case 1, master goes back to Home and this build is blank, which is the state issue 19075 asks to avoid. I could not get there without delays, and the cluster must not be on Home's first page.
▶ Step: a cluster not on Home's page▶ Step: a Service opened from a list that was leftThe request in the test has no requesterId, so its key is pod/default. A list's requests use list-<uid>.
With the invalidation narrowed to the default key, all 52 of 52 tests in the two changed specs still pass, and every list would lose the fix.
▶ Step: the test of dropped pagesThanks Cody, all five points are fixed for me. One non-blocking comment and a nit inline.
Confirmed, `check-cypress-build` passes on 4fd33cb.
Confirmed: I replayed the new steps and delays in a browser, 5 out of 5 pass here and 5 out of 5 fail on master. One thing to know: here the guard is not reached any more, because leaving the list drops its page first, so this test proves the page renders rather than the guard itself.
Confirmed: the page opened through the race now loads into the store and updates. A change made elsewhere shows up, scaling up three times saves each time, and Save after a change elsewhere merges, 3 out of 3 each.
Confirmed, dropping `opt.transient ||` now fails this test.
Thanks, the comment is back.
Not blocking: when the guard hits and the resource isn't on the page that landed, the returned model isn't in the store, and I could still get there in two places. - Opening a cluster while Home's first page is on its way. The navigation guard calls `loadCluster` while Home is still mounted, so Home's unmount can't drop that page. `loadCluster` only checks `isReady` on the result and everything after it reads `currentCluster`, so the Cluster Dashboard stays blank with only the side nav (3 out of 3). Master goes back to Home there. I had to delay both requests, leave the cluster out of Home's answer and block the Configurable Views extension, which fetches the cluster again and heals the page. - The Services list asks for its page only after the nodes request. If it's left in between, that page lands later, and the service page renders but never updates (5 out of 5, with the nodes and the service delayed and the page cut to 5 rows). Master is blank there. Without delays I saw neither.
Nit: this request has no `requesterId`, so the test only covers the `pod/default` key, and a list's requests use `list-<uid>`. With only the default key invalidated, all the tests still pass.
| Job | What happened | From this PR? |
|---|---|---|
| admin navigation and extensions | Failed in all five attempts, on the Kubewarden install, same assertion each time | No. The same assertion in the 8 failing master navigation runs I read |
| admin explorer2 | Failed twice, passes since. The second failure was three DaemonSet redeploy tests and a pod shell test | No. The same four tests fail together in 5 of the 8 recent explorer2 failures on master |
| admin fleet | Failed once, passes since | No. Same failure on 054adb2 |
| check-cypress-build | Passes | Fixed by this push |
054adb2, the commit the branch starts from.