Repository navigation
fix(github): keep linked pull request details across restarts - #749
Merged
Merged
Conversation
The linked pull request list read titles, states and checks only from the GitHub cache row of the account's current access revision. Token rotation moves that revision, so after a restart every linked pull request that was not open in a panel fell back to an unknown state with the repository name, and nothing refreshed it. Persist the last known summary per owner and pull request, bound to the account that read it, and serve it immediately. Stale links refresh in the background once per interval; a failed refresh keeps a specific reason that web, desktop and mobile show with Retry. A repository leaving the installation now invalidates only that repository's cached reads. Related: #501
nixuuu
force-pushed
the
fix/github-pr-persistence
branch
from
November 14, 2026 19:26
e09412b to
581f373
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
Show four linked pull requests by default, with a total count and a motion-token disclosure. Larger lists use pages of at most 20 rows and a bounded scroll area, keeping 500 links cheap to render and animate without changing the summary card's height rules. The gateway caps every list response at 20 summaries, orders open/draft PRs first and then by update time, and returns list-wide branch presence. Background refresh only considers the requested page, combines four PRs per GraphQL request, shares the existing durable budget/backoff, and skips terminal PRs. Thread sync continues to carry only the count, revision and one summary. Validation: - `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, and the web build pass. The final mobile-only adjustment also passes its typecheck. - `TMPDIR=/var/tmp nice -n 10 bun run check:tmp` with the eight affected GitHub integration files: 34 pass, no temp leftovers. After adding the rate-limit scenario, all three large-list tests pass, also with no leftovers. These cover 500-link ordering/paging, owner isolation, restart behavior, linked gateways, detection, watch polling, bounded batching and backoff. No UI tests added. - Real browser review on a disposable remote stack: 0, 1, 4, 5, 50 and 500 links, short/typical/long titles, light/dark, desktop and phone widths. The UI fixture substitutes list responses; gateway tests exercise the actual database and gRPC path. At 500 links, the DOM stays at 20 PR rows. Sampled expansion/collapse heights progress smoothly over the motion token's 250 ms. The reduced-motion CSS guard disables the transition; OS preference emulation was not available. - Before PNGs preserve the supplied references. After PNGs and a short expand/collapse MP4 are saved outside the repository in the review artifacts directory. The disposable stack, database and tunnel are removed after review. Copy audit (§8): “Pull requests” → the same heading with a numeric total, making the full list size visible. “Show N more” / “Show less” remain unchanged; the threshold moves from one to four. New “Previous” / “Next” actions navigate bounded pages, with “1–20 of 500” identifying the range. These use sentence case, short verb-led labels, existing terminology and no new errors or confirmations. Short, typical and long titles retain truncation and full title text on desktop and phone widths. No text depends on color alone. No migration is needed. The card's layout and max-height rules are untouched. Closed/merged PRs refresh only on explicit refresh or opening their full details; list-wide branch presence prevents paging from offering a duplicate create action. Related: #749
This was referenced Nov 16, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 26, 2026
## Changes - Run twelve duration-balanced Linux shards in full PR and Push CI. Verify that all twelve reports cover every discovered test file exactly once. Refresh weights from two complete #1296 runs. - Skip dependency lifecycle scripts for Windows native test installation. The optional SSH CPU feature build took 104–106 seconds in two baseline jobs. The Electron test still downloads its pinned binary and the same native checks run. - Subscribe to the real linked-update overview stream in the integration fixture. Batch rejected diagnostic writes while checking the same limits and recovery. - Prevent a GitHub batch response obtained before permission invalidation from repopulating individual pull request summaries. Persist the last-known summary only while its matching cache row still exists. Serialize cache fills with account- and repository-level invalidation. - Make the proxy usage test share the initial refresh and open later read leases with the existing per-gateway clock. The test still requires exactly one vendor request for the initial read and cache hit. ## Verification - The first twelve-shard run finished in 5m22s and exposed the GitHub race. Windows dependency installation took 41 seconds, down from 168 seconds in the baseline. Full PR and Push CI timings will be measured on green runs. The additional four Linux runners repeat setup and PostgreSQL startup. - The existing integration test now pauses the cached response, triggers permission denial over gRPC, resumes the batch and checks that neither the batch nor a delayed last-known write can restore the old titles. The original code reproduced the stale titles at that barrier. - Twenty-five linked-update and diagnostics cases passed on Bun 1.4.5 and isolated PostgreSQL 18. The shard verifier accepted the complete twelve-report set and rejected eight reports. - The final GitHub change passed 51 integration cases. The proxy change passed all 16 cases in its two adjacent suites. Fixes: #752 Fixes: #749 Related: #1296
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After an app restart, the thread summary card showed some linked pull requests as unknown: a
?icon, the repository name in place of the title, and a!checks icon.Root cause
The linked pull request list read title, state and checks only from
github_pr_cacheat the account's current access revision. A token refresh (every 8 h) moves that revision, and retention prunes the old rows. Nothing refreshes a linked pull request unless its panel is open (the poller only covers watched pull requests). So after a restart, every linked pull request that wasn't open fell back to theunavailableplaceholder, with no reason given.Fix
0146):github_pull_requests.summaryplussummary_account_id, so a summary is only shown when the repository's current connected account read it. It is written after every complete read. The list and the thread'snewest_pull_requestprojection fall back to it, markedstale.pull_request_revision, which fences link and unlink. While a refresh is pending (stalewith nodetail), clients re-read every 3 s instead of every 60 s.PullRequestLink.detailfield (proto change, additive). Lost access (403/404) readsNo access to <repo>. Check the GitHub App installation.Rate limits and network errors keep their existing messages.LinkedPullRequestRowon both. A known pull request shows its state, title and checks. Without details, the row showsLoading pull request…with a spinner, orPull request unavailablewith a warning icon plus the reason and Retry. The checks slot keeps its space but stays empty, so nothing shifts and no misleading!appears.Tests
tests/integration/github-pr-last-known.test.ts(gateway + fake GitHub over loopback):bun install,gen:check,typecheck,lint,format:check, everygithub-*integration suite (one file at a time), the web build, and the mobile Android and iOS exports;check:tmp: 3136 pass, 1 fail. The failure isapps/worker/src/providers/codex/connections.test.ts, which also fails on its own. The locally installed Codex CLI rejects a model provider change on resume. This PR doesn't touch the worker.Copy audit (docs/copy.md §8)
?"Unavailable" iconLoading pull request…(spinner)?icon,!"Checks unavailable"Pull request unavailable(warning icon), no checks iconNo access to itsoltech/wrk-ai. Check the GitHub App installation.+ Retry… Last verified <time>.after a reason when a last known summary is shownGlossary: no new terms. Text checked for long repository names (wraps under the row).
Related: #501