pingdotgg / pingdotgg/t3code

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

Open
#8,640 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with useLiveRefresh and detailQuery.refresh, then trace PullRequestService and the pullRequestEnvironment.invalidate path described in the report. Reproduce the scheduled request and compare the panel with the changed response; done means newer commits, titles, and GitHub Actions status appear without manual refresh, including after the polling eligibility window.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, github-actions, typescript
Domain
api, backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.