Repository navigation
fix(prs): pause the selected-PR detail poller while the window is hidden - #1295
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
The 60s detail-refresh interval in PrsContext was gated only on `active` and `selectedPrId`, so it kept issuing GitHub detail reads while the ADE window was minimized or backgrounded. It now skips ticks while document.visibilityState is hidden — matching the visibility gate the sibling PrDetailPane loops already use — and runs one catch-up refresh on re-show so the detail stays current. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: arul28/ADE/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Problem
The selected-PR detail poller in
PrsContextkept hitting GitHub every 60s while the ADE window was minimized or backgrounded — gated only onactiveandselectedPrId, never on window visibility. The siblingPrDetailPaneloops already gate ondocument.visibilityState, so this was a negative-space gap on the same surface: a hidden window with a selected PR burned ~1 multi-endpoint detail refresh per minute of GitHub quota with nobody watching.Change and boundary
startDetailPollingnow skips its ticks whiledocument.visibilityState === "hidden"(the samevisibilitychange/document.hiddenpattern used byuseActivitySync,useUsageSnapshot, anduseLaneListInvalidation), and replays a singlerefreshDetailSilentlyon re-show so the detail catches up instead of waiting out the next tick. The governor stand-down behavior, the 60s cadence, and the initial-load path are unchanged — this only stops hidden-window polling. Docs updated to describe the present behavior.Verification
pauses the selected PR detail poller while the window is hidden and refreshes on re-showinPrsContext.test.tsx: 120s of ticks while hidden produce zerogetStatuscalls, andvisibilitychange→ visible triggers exactly one catch-up refresh.npx vitest run src/renderer/components/prs/state/PrsContext.test.tsx— 33/33 pass.npm run typecheck— clean;eslinton touched files — 3 warnings, all pre-existing on main.Devin, Cognition AI agent harness.
Link to Devin session: https://app.devin.ai/sessions/0d32eaf142464cfba891fd6427033c28
Open in Devin Desktop: https://app.devin.ai/desktop/session/0d32eaf142464cfba891fd6427033c28?variant=devin
Requested by: @arul28