Repository navigation
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Polling now stops when the last reader leaves and catches up when a reader returns. The new You can add or adjust custom eligibility rules. Learn more. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
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. |
…esign Merge origin/main and keep main's query structure from pingdotgg#23289. The polling timer now sits outside every idle TTL, so it stops with the last reader and catches up on a missed poll when a reader returns. Queries without revalidateOnRemount still show their cached answer on remount. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bles a remount refresh Catch up only from a settled success, and queue the catch-up on the registry scheduler behind any revalidation the remount started, so a signal refresh or revalidateOnRemount check that already ran cancels it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve prior author commits and current main semantics. Recovery by GPT-6.1 Sol/high in Codex through T3 Code; independent high-effort review of the complete frozen contribution. Changed-file gates run immediately after the integration commit to select the actual contribution.





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
The
refreshIntervalMstimer wraps the query outside the factory's idle TTLs, so it stops when the final reader unmounts while cached data remains warm. A returning reader catches up a missed poll. Main now revalidates stale answers on every mount; that behavior is preserved. A registry-local build counter prevents a duplicate request when a signal or cold read already rebuilt the query. Final results suppress automatic interval, signal and remount refresh; explicit refresh remains available.The existing weak cache/member link preserves identity until cache expiry. Only
runtime.tsand its test file change. No UI, RPC or transport change. Maintainer approval of the shared-factory direction remains pending.Known limit: consumers that add their own idle TTL above a polled query still keep it mounted for that TTL.
createUrlsand the project-favicon helpers inassets.tshold asset URL queries (30-minute poll) for 60 minutes, which allows up to two idle refreshes. PR linked-threads has no wrapper, and linked-summary's wrapper lasts 5 s.Scope and approval
This changes shared polling ownership in the query factory, so it needs maintainer review of the direction. No UI, setting, RPC contract or transport change is included. The fix is in the shared query factory, so it applies to mobile, web and desktop query consumers alike. Audit tracker: #189.
Verification
Current candidate 2e5282d, tree
1232461b96a78c8ec90487bbf5d26071ed4ea345, integrates main a472342 without rewriting prior author commits.CI=true TMPDIR=/private/tmp vp run check:changed upstream/mainpassed format, lint, knip, affected-package typechecks and 59/59 shared query lifecycle tests. All commands retained their actual exit status. No repo-wide test run.node:delegated-task:command%3Amcp%3A05f1a96a-5b49-41a2-bc99-96140e5986df%3Adelegate-task%3Afinish-t3-four-repairs-review-20261114completed. It inspected source and test receipts without rerunning the suites.Historical verification and retained author credits (earlier revisions)
Verification
At head
3431a69, merged with main5959787:CI=true vp test runonruntime.test.ts,filesystem.test.ts,assets.test.tsandpullRequests.test.ts: 143 tests passed, including main's folder-picker reopen test from fix(client-runtime): reopening a folder picker refreshes its listing #23289 (unchanged).CI=true vp run check:changed: format, lint, knip, typecheck (7 packages) and tests passed.runtime.ts, five idle-polling regressions fail: "polls only for real readers…" (interval, interval and signal), "stops polling independently of cache TTL (3600000)", "cancels an obsolete periodic query when its session is replaced", and "queries afresh once after a polled query's cache expires". The new test "shows the cached answer without querying when remounted past its stale time" passes on main and fails on this PR's earlier runtime, which re-checked stale data on every remount.revalidateOnRemountquery.These are fixture query-operation counts, not wire-traffic or energy measurements. Maria's verification report covered real web request counts at the earlier a64ca2a head, which used a different implementation, and was not repeated. Current-head native iOS/Android, Electron, remote/relay/tunnel, battery impact and Hermes performance are unverified.
Created with: original implementation and independent review in separate GPT-6.1 Sol/high sessions through Codex in T3 Code. Rework onto main's
revalidateOnRemountdesign: Claude Opus 5.5 through Claude Code in T3 Code, with independent review by GPT-6.1 Sol/high through Codex in T3 Code.Current-main conflict repair: GPT-6.1 Sol/high in Codex through T3 Code.