Skip to content

fix(prs): pause the selected-PR detail poller while the window is hidden - #1295

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/prs-detail-poller-visibility
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/prs-detail-poller-visibility

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The selected-PR detail poller in PrsContext kept hitting GitHub every 60s while the ADE window was minimized or backgrounded — gated only on active and selectedPrId, never on window visibility. The sibling PrDetailPane loops already gate on document.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

startDetailPolling now skips its ticks while document.visibilityState === "hidden" (the same visibilitychange/document.hidden pattern used by useActivitySync, useUsageSnapshot, and useLaneListInvalidation), and replays a single refreshDetailSilently on 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

  • New regression test pauses the selected PR detail poller while the window is hidden and refreshes on re-show in PrsContext.test.tsx: 120s of ticks while hidden produce zero getStatus calls, and visibilitychange → 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; eslint on 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


Devin Review

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>
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
ade Ignored Ignored Sep 23, 2026 9:31am UTC

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: arul28/ADE/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e4fc6d7c-317e-4c62-9a63-b175cdf5b559

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant