Skip to content

[Bug]: Pull request detail panel stays stale after automatic refresh #8640

Description

@gfdelarue

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Start the web app from main.
  2. Open a pull request in the right-hand detail panel.
  3. Keep the panel visible without interacting with it.
  4. Push a commit or wait for a GitHub Actions check to change.
  5. Leave the panel open through its automatic live refresh.
  6. Open More pull request actions and select Refresh.

I also reproduced this without modifying GitHub. An isolated server used a local wrapper around gh pr view. The first detail request returned the original public response. Later requests returned the same response with only title and updatedAt changed.

Expected behavior

The pull request panel should be a live view of the open pull request. While the panel is visible, it should show new commits and GitHub Actions status changes without requiring manual refresh.

A bounded polling cadence is reasonable, but the panel should display newer data after an automatic request receives it.

Actual behavior

In the common passive-watching flow, the panel can remain stale indefinitely. The automatic request reaches the host and receives the changed detail, but the panel continues to show the old title or check state. Selecting Refresh updates it immediately.

In the deterministic reproduction:

  • The initial detail request returned the original title.
  • A later automatic request returned the changed title.
  • A DOM check after that request still found the original title in the panel heading.
  • The manual refresh changed the panel heading to the new title.

The likely cause is the interaction between the refresh and cache windows:

  • useLiveRefresh calls detailQuery.refresh every five minutes while the view is eligible.
  • PullRequestService can return a held detail for five minutes while it refreshes the provider cache in the background.
  • The first scheduled poll can receive that held value while the server updates its private cache.
  • The client receives no update when the background refresh finishes.
  • Automatic polling stops after six minutes without interaction. The next five-minute poll is therefore ineligible, so it never collects the refreshed value.
  • The manual action calls pullRequestEnvironment.invalidate before refreshing, which bypasses the held value.

Impact

Major degradation or frequent failure

This breaks a primary reason to keep the panel open: watching CI after a push. The displayed status looks current but can be obsolete, so users must remember to refresh it manually.

In practice, I still have to keep the GitHub pull request page open to monitor CI reliably. That defeats the purpose of the T3 Code panel: it duplicates GitHub instead of replacing that context switch, while presenting stale status as if it were current.

Version or commit

main at be7d35aaeb49a04483ec5e0d2284e8b5b70a3b6e

Environment

Web client on Linux with an isolated local T3 home.

Logs or stack traces

initial request: detail original
automatic request: detail changed
panel heading after automatic request: original
panel heading after manual refresh: changed

Workaround

Open More pull request actions and select Refresh after every expected pull request or check update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions