You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Follow-ups from the #4067 review: pin the session-probe gate's untested branches, batch its cache listener, stale docs and dead mocks #4078
Source: agent #2's independent review of PR #4067 (merged as 2a169f4c7, Refs #4062), the items marked "Non-blocking (P3), for follow-up" in #4067 (comment). The fleet manager (TALE-357) filed this so the follow-ups are tracked in one place. Nothing below has been re-verified beyond that review.
Unpinned branches. Four one-change mutants pass every case:
snapshot = read even when not asked. "False when not asked" holds only because the quiet hook mounts while the probe is null;
subscribe returning () => {}, which is a gated read that leaks its cache listener on unmount;
the listener ignoring the probe's hash;
useAutomationSettingsValues never gating its unadapted lane, which is unreachable today.
Seeding a user before the quiet mount, and asserting that getQueryCache().hasListeners() is false after unmount, would pin the first two.
Robustness. The cache listener isn't wrapped in notifyManager.batchCalls, as react-query's own useIsFetching is. No failing case was found.
The gate's cache lifetime rests on root observers. It holds none of its own, and a garbage-collected probe reads as signed out until something remounts.
One of those observers is ColdLoadProbe. Its doc (main.tsx:44-45) still says "Dev-only probe … the one request every auth-gated read waits on", and both halves are now wrong.
The hook's "(as a mounting observer would)" overstates: an observer also keeps the query and refetches on reconnect.
Comment and naming nits:
use-backend-query.ts:117-118 says "resolves", while the doc says "holding a user";
use-session-probe.ts:14-15 says only removal is linear, but adding is too;
use-settings-values.ts:77-79 still talks of a Convex socket;
the local isAuthenticated in useBackendQuery reads false for every adapted read, so gateOpen would be a safer name.
Dead useSessionUser mocks, beyond the six the PR named:
user-button.test.tsx;
dashboard-layout.test.tsx, whose "drives both" comment is now wrong;
dashboard-shell.browser.test.tsx;
account-form.name.test.tsx, account-form.password.test.tsx and forced-change-password.test.tsx.
The reviewer found that no assertion became vacuous.
Tracked elsewhere: the review's item 6 belongs with #3671 (account name saves leave stale user data). There, users/mutations:updateUserName (settings.ts:1276-1281) invalidates nothing, so a renamed user's probe answer refreshes only when a probe observer mounts, or after the 5-minute stale window.
Acceptance
Tests pin item 1's branches: each mutant is killed.
The listener batches its notifications, or the PR says why not.
Comments and docs match the behaviour.
The dead mocks are removed without making any assertion vacuous.
Activity
test(platform): pin session-probe gate branches and batch notificatio…