Repository navigation
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The PR changes shared client-runtime cache, invalidation, revalidation, and polling ownership used by multiple query families, making its production blast radius broader than a small bug fix. It also adds a line-level static-analysis diagnostic suppression in the runtime implementation. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Cached query and signal refresh packages/client-runtime/src/state/runtime.ts, packages/client-runtime/src/state/runtime.test.ts |
The cached query retains idle TTL and applies refresh-trigger handling. Signal changes refresh only when a prior non-final result exists. Tests cover idle signal retention and cache expiry. |
Live revalidation and polling packages/client-runtime/src/state/runtime.ts, packages/client-runtime/src/state/runtime.test.ts |
A live wrapper revalidates stale or unsuccessful non-final results, and periodic refresh runs while readers are mounted. Tests cover revalidation, polling, final results, and session replacement. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Suggested reviewers: t3dotgg, juliusmarminge
Merge Risk: 
Minimal · previous review 9906a
-
Visible polling still reaches the query, and no actionable merge-blocking issue remains after normal checks.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 warning Passed checks: 3 passedFull details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It provides detailed behavior, scope, tests, results, and unverified areas. However, the Scope and approval section explicitly states that upstream maintainer approval is pending and provides no approval comment or qualifying exemption.
Resolution
Obtain explicit maintainer approval for the shared cache, invalidation, revalidation, polling ownership, and diagnostic suppression changes. Add a link to the approval discussion and the approval comment to the Scope and approval section before merging.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Note Written by thanks @saphid. separating the cached answer and signal revision from the live polling subscription fixes the ownership bug while preserving cached reopen behavior. i kept your implementation and all regression coverage, and merged current main ( two independent shared-query reviews found no correctness blockers or safe substantial simplification. the build counter prevents duplicate synchronous revalidation; replacing the tracked cache with stock swr would retain source subscriptions. the diff remains two files, +438/-24, with no changes to your runtime patch. verification:
unverified: native ios/android, electron, remote/relay/tunnel runtime, physical battery impact. an already-started request may complete under the retained cache lifetime. maintainer approval of the shared-query lifetime change remains for maria's review, as the approvability comment requests. matching full-window captures show the same live pr, with no intended appearance change. |
|
Note Written by Verified in a real dev environmentVerified exact head Started Observed actual
These are real request counts, not battery or latency measurements. The recording preserves the full idle interval and shows elapsed time. Blacksmith verification on this head passed: 132 focused tests across runtime, assets, pullRequests, fileMetadata, threadFamilies and olderSettledThreads; Command and request transcript Not verifiedNative iOS/Android, Electron, remote/relay/tunnel connections, providers other than Codex, physical battery impact and Hermes performance were not exercised on this Linux web-client pass. Already-started requests may still finish under the existing cache policy. The separate maintainer scope approval mentioned in the PR description remains pending. |





Problem
Shared query caches retain recurring polling after the final reader leaves. For example, navigating away from a mobile PR detail can leave linked-thread refreshes running during the five-minute cache lifetime, although the screen has no reader.
Change
Keep cached answers and signal revisions together, while disposable outer wrappers own mount revalidation and recurring polling. Preserve synchronous cached reads on reopen, configured TTLs, visible intervals, manual refresh, final answers and session cancellation. Distinguish a source rebuild during a read from a stale cached answer so synchronous signal/session refreshes execute once on remount. An already-started request may still finish while idle under its existing TTL policy.
Scope and approval
Upstream maintainer approval of direction and scope is pending; this PR is not ready to merge. Macroscope reconfirmed “Needs Human Approval” at 9906abb because this changes shared cache, invalidation, revalidation and polling ownership, and adds a line-level globalDate diagnostic suppression. No explicit maintainer approval link is available. Green CI and verification comments do not supply that approval.
The recurring subscription belongs to the shared query factory; a mobile focus callback cannot release it. The same ownership correction therefore serves mobile, web and desktop query consumers. No UI, setting, RPC contract or transport change is included. Audit tracker: #189.
Verification
Integrated upstream dac8b11. At the current head:
CI=true vp test run packages/client-runtime/src/state/runtime.test.ts packages/client-runtime/src/state/assets.test.ts packages/client-runtime/src/state/pullRequests.test.ts: 107 tests passed, with no actionable source findings.CI=true vp run check:changed dac8b11ddc25bd5da62a367fdb6c3de777ae2986passed after the integration commit.Real query-factory/AtomRegistry regressions use controlled timers: after final-reader removal, the quiet-signal baseline executes three extra query operations over three intervals; the candidate executes zero. Coverage includes interval-only and asset queries, multiple readers, cached reopen/revalidation, manual refresh, final results, expiry, and signal/session replacement. These are fixture query-operation counts, not wire-traffic or energy measurements.
Historical evidence: the earlier iOS navigation/display smoke check preserved PR-detail back/reopen behavior, but was not repeated after this integration. Maria’s verification report describes real web request-count and reopen/manual-refresh checks at the prior a64ca2a head; those observations and media were not independently replayed here. Current-head native iOS/Android, Electron, and remote/relay/tunnel compatibility remain unverified. The supported device host is unavailable. Physical battery impact and Hermes performance are unmeasured.
Implementation and independent review: separate GPT-6.1 Sol/high sessions through Codex in T3 Code.