You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one repository in an environment fails during mobile pull request pagination, loadNextPages in apps/mobile/src/features/pull-requests/usePullRequestList.ts throws on response.value.errors.length before appending the healthy repositories' rows or updating nextCursors. Because PullRequestService.list returns successful repositories' entries and updated nextCursors alongside failed repositories' errors and retained retry cursors in one RPC response, Load more discards the healthy page and Retry re-requests the exhausted healthy cursor.
Deterministic repro on origin/main (3067c4984715c28dfcd7eb85b434535ad210d8b5):
Mount usePullRequestList (as PullRequestsScreen does) with one environment whose head returns [PR #1] and nextCursors: { "github.com ok/repo": "cursor-a", "github.com bad/repo": "cursor-b" }.
Have the cursor continuation return a successful PullRequestListResult with entries: [PR #2] (from ok/repo), nextCursors: { "github.com bad/repo": "cursor-b" }, and errors: [{ projectId: "bad", projectTitle: "Bad", message: "bad failed." }].
Run vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx.
Observed on origin/main:loadMore() leaves entries at [1] (discarding PR Add open-in-editor feature with Cmd+O shortcut #2) and keeps both starting cursors, failing expect(probe.latest.entries.map((row) => row.number)).toEqual([1, 2]).
Expected:entries shows [1, 2], loadMoreError reports "bad failed.", and loadMore(true) (Retry) sends only { "github.com bad/repo": "cursor-b" }.
Change
In apps/mobile/src/features/pull-requests/usePullRequestList.ts, compute next via appendPullRequestListPage before throwing on response.value.errors.length, and write next to pullRequestListPagesFamily only when the errored response made progress relative to the request-start page and sent cursors (response.value.entries.length, cursor change from input.cursors ?? pages.nextCursors, or truncated change from pages.truncated). Comparing against the sent cursors prevents a zero-progress error from marking continued: true or overwriting a newer cursor arrived via an in-flight subscription head refresh. The clean-success path is unchanged; web (PullRequestsPage) already reads partial entries and nextCursors without throwing on errors; no contract, server, or i18n changes are needed.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Base failure (3067c4984715c28dfcd7eb85b434535ad210d8b5):vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx failed 1/4 (keeps healthy rows and advances cursors when another repository fails during load more: AssertionError: expected [ 1 ] to deeply equal [ 1, 2 ]).
Head pass (018291b48e3987d80336a626acce8d772ed4952b):vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx passed 4/4, covering partial-error row retention, Retry sending only the failed repository cursor, and ignoring a zero-progress repository error even after an in-flight head refresh changes rows and cursors.
vp run check:changed (018291b48e3987d80336a626acce8d772ed4952b): exit 0 (format, lint, knip, typecheck across 2 packages, test 4/4, and react compiler 6/6).
Not shown: Before/after iOS/Android simulator captures and a scenarios:prove screen run against PullRequestsScreen driving Load more and Try again through the native list UI.
Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown
apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx:281 — The transcript does not show native before/after output. Capture the missing healthy row on base and the retained row alongside Try again on head.
apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx:183 — The hook repro is deterministic but not ready to run as a native scenario. Use server-valid timestamp cursors and truncated: true while a cursor remains, then drive Load more and Try again through PullRequestsScreen.
.github/pull_request_template.md:9 — Call 3067c49 the tested main snapshot rather than the current origin/main tip; the local tracking ref has advanced, but the relevant mobile, server, and client-runtime paths are unchanged.
Macroscope's review found this PR approvable — Mobile pull-request lists retain healthy pagination results when another repository reports an error, while still surfacing the failure. The change is limited to transient list state and does not alter remote data or product defaults.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between cb334a6 and 08aae0f.
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
No actionable comments were generated in the recent review.
Walkthrough
The pull request changes how loadNextPages stores pages when a paginated response includes errors. It adds tests for retrying remaining cursors and preserving refreshed rows when an earlier pagination request completes with no progress.
Changes: Pagination error handling
Layer / File(s)
Summary
Pagination state and retry tests apps/mobile/src/features/pull-requests/usePullRequestList.ts, apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx
loadNextPages stores pages from errored responses when entries, cursors, or truncation state change, then reports the errors. Tests cover retries after partial results and head refreshes.
Mobile pull-request pagination now keeps healthy rows and cursors when one repository fails, so Load more and Retry behave correctly. No concrete merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: mobile pull request pagination now keeps healthy repositories' pages when another repository fails. It matches the changed loadNextPages logic in usePullRequestList.ts…
Description check
The description follows the template: it has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the fi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: mobile pull request pagination now keeps healthy repositories' pages when another repository fails. It matches the changed loadNextPages logic in usePullRequestList.ts and the objectives. It follows the conventional commit form and is specific.
Full details: Description check
Explanation
The description follows the template: it has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the fix and why web is unaffected. Scope explains why no issue is linked. Verification gives focused test results (base failure 1/4, head pass 4/4) and states what was not checked (native simulator captures and scenarios:prove). The template's before/after screenshot requirement for UI changes is not fully met, but the change is a logic fix in a hook, and the author states the missing native evidence. The description includes an agent attribution line, as the template asks. Minor gaps remain: the Scope section does not link an issue, and the Verification section references a gist. These gaps are not critical.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Real iOS app, iPhone 18 Pro / iOS 27.2, 402×874, light theme. Fresh isolated servers and the same two real repositories on both commits. Complete a healthy refresh, make only GitLab's isolated CLI endpoint unavailable, scroll to the end, then retry.
Base stayed at #48047 after retry. Head retained rows through #47980, then retry advanced through #25495 with GitLab still unavailable:
Seed driver · Interaction script · Sanitized real server trace summary. Traces confirm successful GitHub reads and overall pagination RPCs alongside failed GitLab reads on both sides. Stills were inspected and verified stable. The head video excerpt ends during retry progression; the final retry state is shown in the still above.
Not shown:
The zero-progress error/newer subscription-head race and continued flag were not exercised on device.
Exhausting the healthy repository and confirming that later retries omit its cursor were not exercised; the recorded retry demonstrates cursor advancement while healthy pages remain.
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
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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
When one repository in an environment fails during mobile pull request pagination,
loadNextPagesinapps/mobile/src/features/pull-requests/usePullRequestList.tsthrows onresponse.value.errors.lengthbefore appending the healthy repositories' rows or updatingnextCursors. BecausePullRequestService.listreturns successful repositories'entriesand updatednextCursorsalongside failed repositories'errorsand retained retry cursors in one RPC response, Load more discards the healthy page and Retry re-requests the exhausted healthy cursor.Deterministic repro on
origin/main(3067c4984715c28dfcd7eb85b434535ad210d8b5):usePullRequestList(asPullRequestsScreendoes) with one environment whose head returns[PR #1]andnextCursors: { "github.com ok/repo": "cursor-a", "github.com bad/repo": "cursor-b" }.PullRequestListResultwithentries: [PR #2](fromok/repo),nextCursors: { "github.com bad/repo": "cursor-b" }, anderrors: [{ projectId: "bad", projectTitle: "Bad", message: "bad failed." }].vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsx.origin/main:loadMore()leavesentriesat[1](discarding PR Add open-in-editor feature with Cmd+O shortcut #2) and keeps both starting cursors, failingexpect(probe.latest.entries.map((row) => row.number)).toEqual([1, 2]).entriesshows[1, 2],loadMoreErrorreports"bad failed.", andloadMore(true)(Retry) sends only{ "github.com bad/repo": "cursor-b" }.Change
In
apps/mobile/src/features/pull-requests/usePullRequestList.ts, computenextviaappendPullRequestListPagebefore throwing onresponse.value.errors.length, and writenexttopullRequestListPagesFamilyonly when the errored response made progress relative to the request-start page and sent cursors (response.value.entries.length, cursor change frominput.cursors ?? pages.nextCursors, ortruncatedchange frompages.truncated). Comparing against the sent cursors prevents a zero-progress error from markingcontinued: trueor overwriting a newer cursor arrived via an in-flight subscription head refresh. The clean-success path is unchanged; web (PullRequestsPage) already reads partialentriesandnextCursorswithout throwing onerrors; no contract, server, or i18n changes are needed.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
3067c4984715c28dfcd7eb85b434535ad210d8b5):vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsxfailed 1/4 (keeps healthy rows and advances cursors when another repository fails during load more:AssertionError: expected [ 1 ] to deeply equal [ 1, 2 ]).018291b48e3987d80336a626acce8d772ed4952b):vp test run apps/mobile/src/features/pull-requests/usePullRequestList.test.tsxpassed 4/4, covering partial-error row retention, Retry sending only the failed repository cursor, and ignoring a zero-progress repository error even after an in-flight head refresh changes rows and cursors.vp run check:changed(018291b48e3987d80336a626acce8d772ed4952b): exit0(format,lint,knip,typecheckacross 2 packages,test4/4, andreact compiler6/6).check:changedtranscript: https://gist.github.com/saphid/ba23ac49994123579add7b9b2f9cbb59scenarios:provescreen run againstPullRequestsScreendriving Load more and Try again through the native list UI.Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown