GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(forgejo): Closed lists read long merged histories in bounded slices by only21mil · Pull Request #21657 · pingdotgg/t3code

Conversation

@only21mil

@only21mil only21mil commented Oct 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Problem

On a Forgejo repository whose closed history is mostly merged, opening Pull requests > Closed can read the whole history in one request. Forgejo has no merged list state, so the Closed view asks for state=closed and, since #24772, keeps only the rows whose mapped state matches; the list loop stops only once it has limit matching rows.

Change

ForgejoPullRequestProvider.listChangeRequests now stops after limit rows read, kept or not, and cursorAdvance already lets the next slice resume after the last one. PullRequestService.nextListCursor continues a list past a slice that came back empty while its host read rows (cursorAdvance > 0), so older matches are not cut off; an empty slice that read nothing still ends the list. On screen, when the newest limit closed rows are all merged, the Closed tab shows its empty state with Load more pull requests.

Scope

Bug fix for a performance problem: one Closed request walks the whole closed history. Small fix with no issue; the Forgejo request logs below show it. Narrowed at the maintainer's request in review to the bounded scan and the empty-slice continuation. No new setting or API. The merged/closed filtering is #24772's work; this PR only bounds the scan.

Verification

To see it on Linux web: 1. seed a local Forgejo (50 rows per page) with one PR closed without merging, then 100 merged after it; 2. open Pull requests > Closed in the web client; 3. on main, Forgejo's request log shows each list request reading all three pages.

Revisions: main 7462f234e8, this head 5bbb14bcf1, and the head merged locally with that main, e66d7b4bbc (not pushed).

Web, main: three list requests, each read all three pages; #1 is listed. Web, head and merged: the first slice reads two pages (99 merged rows), keeps none, and offers Load more pull requests; one Load more reads the rest and shows #1.

Phones (main's app, since the change is server-only): on main one request reads all three pages. On head and merged the app continues past the empty slices by itself: four requests, each within its 30-row budget, then #1. Reaching #1 took eight page reads in all on head and merged, against three on main.

main 7462f234e8 head 5bbb14bcf1 merged e66d7b4bbc
Web, Closed Web, main 7462f23, Closed: #1 listed
Web, main 7462f234e8, Closed: #1 listed
Web, head 5bbb14b, Closed: empty first slice with Load more pull requests
Web, head 5bbb14bcf1, Closed: empty first slice with Load more pull requests
Web, merged e66d7b4bbc, Closed: empty first slice with Load more pull requests
Web, merged e66d7b4bbc, Closed: empty first slice with Load more pull requests
Web, after Load more Web, head 5bbb14b, after Load more: #1 listed
Web, head 5bbb14bcf1, after Load more: #1 listed
Web, merged e66d7b4bbc, after Load more: #1 listed
Web, merged e66d7b4bbc, after Load more: #1 listed
Android, Closed Android, main 7462f23 server, Closed: #1 listed
Android, main 7462f234e8 server, Closed: #1 listed
Android, head 5bbb14b server, Closed: #1 listed
Android, head 5bbb14bcf1 server, Closed: #1 listed
Android, merged e66d7b4bbc server, Closed: #1 listed
Android, merged e66d7b4bbc server, Closed: #1 listed
iOS, Closed iOS, main 7462f23 server, Closed: #1 listed
iOS, main 7462f234e8 server, Closed: #1 listed
iOS, head 5bbb14b server, Closed: #1 listed
iOS, head 5bbb14bcf1 server, Closed: #1 listed
iOS, merged e66d7b4bbc server, Closed: #1 listed
iOS, merged e66d7b4bbc server, Closed: #1 listed

Tests: this head's two test files fail 3 and pass 114 on main's code; all 117 pass on the head and all 121 on the merged tree.

Not checked:

  • Desktop. It wraps the web client.
  • A Forgejo server with slow pages.
Method, Forgejo request logs and test output

Change detail: the provider loop condition is consumed < input.limit; the cursor keeps the previous boundary, or the read time on the first slice; Load more continues from where the slice stopped.

Tests detail: with this head's two test files on main's code, PullRequestService.test.ts and ForgejoPullRequestProvider.test.ts fail 3 (the two continuation rows and the state-filter assertion) and pass 114.

Revisions were run in this order: main 7462f234e8 (green push CI; main has newer commits that this run did not use), this head 5bbb14bcf1, then the merged tree e66d7b4bbc.

Fixture: a throwaway local Forgejo 17.0.1 seeded with #1 closed without merging, #2 to #101 merged after it, and #102 and #103 open. It serves 50 rows per page. One T3 dev server per revision, as "Test machine", with tea signed in to that Forgejo. The web client ran in the T3 Browser panel and asks for 99 rows. The phones ran today's main app: an iPhone 17 Pro simulator (iOS 26.5) and a Pixel 10 emulator (Android 16, software rendering). The mobile list asks for 30 rows per slice. Before, an empty slice ended the list, which would cut off older matches once the provider stops at its budget; Forgejo resumes from the delivered offset. Forgejo's own request log records every page read. The screen ends the same on all three revisions on the phones.

Before, web, main 7462f234e8:

## web client, main 7462f234e8, Pull requests > Closed opened at 04:30:34
## grep 'pulls?' in the Forgejo log between 04:30:33 and 04:30:46 UTC, lines unedited
2026/11/12 04:30:38 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:58002, 200 OK in 419.8ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:38 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:58012, 200 OK in 418.8ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:38 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:58024, 200 OK in 14.2ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:58044, 200 OK in 347.4ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:58052, 200 OK in 355.5ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:58054, 200 OK in 376.7ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:58056, 200 OK in 370.9ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:58058, 200 OK in 13.6ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:30:39 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:58060, 200 OK in 12.6ms @ repo/pull.go:49(repo.ListPullRequests)

After, web, head 5bbb14bcf1, first slice:

## web client, head 5bbb14bcf1, Pull requests > Closed opened at 04:34:04
## grep 'pulls?' in the Forgejo log between 04:34:03 and 04:34:14 UTC, lines unedited
2026/11/12 04:34:08 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:44194, 200 OK in 410.3ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:34:08 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:44210, 200 OK in 379.1ms @ repo/pull.go:49(repo.ListPullRequests)

Head 5bbb14bcf1, Load more:

## web client, head 5bbb14bcf1, Load more pull requests clicked at 04:34:15
## grep 'pulls?' in the Forgejo log between 04:34:14 and 04:34:25 UTC, lines unedited
2026/11/12 04:34:16 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:38244, 200 OK in 345.9ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:34:16 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:38260, 200 OK in 357.2ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:34:16 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:38270, 200 OK in 12.1ms @ repo/pull.go:49(repo.ListPullRequests)

Merged e66d7b4bbc, first slice and Load more:

## web client, merged e66d7b4bbc, Pull requests > Closed opened at 04:37:37
## grep 'pulls?' in the Forgejo log between 04:37:36 and 04:37:47 UTC, lines unedited
2026/11/12 04:37:41 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:39978, 200 OK in 354.1ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:37:41 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:39984, 200 OK in 341.1ms @ repo/pull.go:49(repo.ListPullRequests)
## web client, merged e66d7b4bbc, Load more pull requests clicked at 04:37:48
## grep 'pulls?' in the Forgejo log between 04:37:47 and 04:37:58 UTC, lines unedited
2026/11/12 04:37:49 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:50106, 200 OK in 411.5ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:37:49 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:50108, 200 OK in 421.2ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:37:49 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:50118, 200 OK in 11.0ms @ repo/pull.go:49(repo.ListPullRequests)

Android, main 7462f234e8:

## Android app (main's app) against the main 7462f234e8 server, Closed tapped at 04:31:21
## grep 'pulls?' in the Forgejo log between 04:31:21 and 04:31:36 UTC, lines unedited
2026/11/12 04:31:22 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:49476, 200 OK in 449.3ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:31:22 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:49492, 200 OK in 374.9ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:31:22 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:49494, 200 OK in 13.7ms @ repo/pull.go:49(repo.ListPullRequests)

Android, head 5bbb14bcf1:

## Android app (main's app) against the head 5bbb14bcf1 server, Closed tapped at 04:34:58
## grep 'pulls?' in the Forgejo log between 04:34:58 and 04:35:14 UTC, lines unedited
2026/11/12 04:34:59 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:46140, 200 OK in 408.8ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:00 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:46152, 200 OK in 412.7ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:00 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:46162, 200 OK in 372.9ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:01 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:46170, 200 OK in 315.6ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:01 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:46176, 200 OK in 311.3ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:01 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=1 for 127.0.0.1:46184, 200 OK in 322.7ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:02 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=2 for 127.0.0.1:46188, 200 OK in 305.7ms @ repo/pull.go:49(repo.ListPullRequests)
2026/11/12 04:35:02 ...eb/routing/logger.go:109:func1() [I] router: completed GET /api/v1/repos/sample/project/pulls?state=closed&sort=recentupdate&limit=50&page=3 for 127.0.0.1:46202, 200 OK in 15.5ms @ repo/pull.go:49(repo.ListPullRequests)

iOS logs (main, head, merged) and the Android merged log have the same shape as the Android ones above.

Tests, main with the head's test files:

$ vp test run apps/server/src/pullRequest/PullRequestService.test.ts packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.test.ts   # main 7462f234e8 with only the PR head's two test files
[04:18:27.157] ERROR (#6): Error [AssertionError]: expected { …(4) } to deeply equal { items: [], truncated: true, …(2) }
  expected: { items: [], truncated: true, continues: true, cursorAdvance: 1 },
   × filters listed pull requests by the requested state 8ms
[04:18:30.531] ERROR (#5152): Error [AssertionError]: expected {} to deeply equal { Object (github.com pingdotgg/t3code) }
  expected: { 'github.com pingdotgg/t3code': '2026-07-02T00:00:00Z|4|7' },
[04:18:30.569] ERROR (#5546): Error [AssertionError]: expected {} to deeply equal { Object (github.com pingdotgg/t3code) }
  expected: { 'github.com pingdotgg/t3code': '2026-07-03T00:00:00.000Z|3|' },
   × carries a list on past an empty slice whose host consumed rows 32ms
   × carries a list on from its read time when the first slice kept nothing 35ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯
 FAIL  |t3| src/pullRequest/PullRequestService.test.ts > carries a list on past an empty slice whose host consumed rows
AssertionError: expected {} to deeply equal { Object (github.com pingdotgg/t3code) }
 FAIL  |t3| src/pullRequest/PullRequestService.test.ts > carries a list on from its read time when the first slice kept nothing
AssertionError: expected {} to deeply equal { Object (github.com pingdotgg/t3code) }
 FAIL  |root| packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.test.ts > filters listed pull requests by the requested state
AssertionError: expected { …(4) } to deeply equal { items: [], truncated: true, …(2) }
 Test Files  2 failed (2)
      Tests  3 failed | 114 passed (117)
exit 1

Generated with Claude Opus 5.5 in T3 Code Nightly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 19, 2026
macroscopeapp[bot]
macroscopeapp Bot approved these changes Oct 19, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b5f9321

Macroscope's review found this PR approvable — This is a narrowly scoped, well-tested Forgejo list bug fix that corrects merged/closed filtering and preserves pagination through slices containing only filtered rows. It has no schema, deployment, security, billing, default, or static-analysis configuration impact.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

  • Last reviewed commit: 4222b188c00d316c8369c9aa05d1b7145862f429
  • Latest commit, not reviewed: 5bbb14b

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Forgejo closed pull-request listings now distinguish merged and unmerged requests. Pagination counts rows read, including filtered rows. The listing service can continue through empty slices when the provider reports row advancement.

Changes: Pull-request listing pagination

Layer / File(s) Summary
Forgejo filtering and slice advancement
packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
The merged listing includes merged requests, and the closed listing excludes them. Slice limits and cursor advances count rows read, including filtered rows. Tests cover filtered slices, continuation, and long merged histories.
Continuation cursor handling
apps/server/src/pullRequest/PullRequestService.ts, apps/server/src/pullRequest/PullRequestService.test.ts
The listing service uses provider-reported advancement and the observed read time when available. An empty slice gets a cursor only when the provider reports consumed rows. Tests cover Forgejo pagination and empty GitHub results without consumed rows.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 4222b

No actionable merge-blocking risk remains in the reviewed pagination changes.

Architecture risk: Low · up to 4222b

The change affects 2 systems.

Changed systems: apps/server, packages/source-control-forgejo

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — apps/server (service) was modified; 2 changed files map to changed impact.
  • observed — packages/source-control-forgejo (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts: The listing adds a row predicate: merged keeps only merged rows, while closed keeps only rows that are not merged. Other states keep all rows.
  • observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts: Comments now specify that continuation offsets count all rows read, including filtered rows, and that a slice reads at most limit rows even if few or none pass the filter.
  • observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts: Rows are now added to the result only when they pass the state-specific predicate; previously every non-null row was included.
  • observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts: Adds a closed pull-request fixture with generated request metadata and merge-dependent merged_at.
Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the Forgejo closed-list change and its bounded-scan behavior.
Description check Passed The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and it gives a clear reason for the change. The problem is a Forgejo Closed view that…
Full details: Description check

Explanation

The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and it gives a clear reason for the change. The problem is a Forgejo Closed view that reads the full closed history in one request when most closed pull requests are merged. The change caps each slice at the requested limit and continues listing past empty slices that consumed rows. Scope states this is a bug fix with no issue, and it notes the maintainer narrowed the review scope. Verification includes seeded-fixture reproduction steps, Forgejo request logs for main, head, and merged revisions, screenshots, test counts before and after, and a list of what was not checked (desktop, slow-page servers). The Problem section also lacks an issue link, which the Scope section explicitly allows for small obvious fixes. The description also states that the signed-in user's grouping changed after Load more without tracing the cause, which the template's scope and verification guidance would expect to be resolved or tracked. The title is not shown in the description body, so its conventional-commit form cannot be checked here. Overall the description is mostly complete.

Finishing Touches

🧪 Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
ℹ️ Recent review info

⚙️ Run configuration

  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 967864d3-98c8-4b4b-a886-9d0ffd564625
📥 Commits

Reviewing files that changed from the base of the PR and between 585d36572fe6304542bba9e7583847d8200a9696 and 4222b188c00d316c8369c9aa05d1b7145862f429.

📒 Files selected for processing: 1

  • apps/server/src/pullRequest/PullRequestService.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

only21mil and others added 6 commits October 31, 2026 22:37
@only21mil @claude
fix(forgejo): distinguish merged pull requests from closed unmerged ones
4c64b39
Forgejo lists merged pull requests under state=closed, and the provider
returned every row it read, so the Closed and Merged views showed the same
list. Keep only rows whose merged flag matches the requested view. The
continuation cursor still counts every row read, and the walk reads past
pages whose rows were all excluded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
fix(forgejo): keep each list slice to its row budget
7ddcfd1
A slice that kept few rows read on until it had a full limit of them, so
the Closed view of a repository where most closed pull requests were
merged read many more pages than before. Stop after about limit rows as
before, and read on only while the slice has kept nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
fix(forgejo): carry the list on from a slice that kept nothing
ec704f3
A Closed slice that kept no rows read on to the end of a merge-only
history, so one repository could hold the list for many slow pages.
The provider stops at its row budget again, and the service now issues
a continuation for an empty slice whose host consumed rows, from the
previous boundary or the read time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
test(forgejo): fold the empty-slice continuation into fake-provider c…
0975359
…ases

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
refactor(forgejo): keep list rows by their mapped state
b3bf209
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
test(server): cover a list whose first slice kept nothing
8caefe9
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil
only21mil force-pushed the fix/forgejo-merged-closed-list branch from 4d07d58 to 8caefe9 Compare November 1, 2026 00:33
@maria-rcks
Merge remote-tracking branch 'github/main' into fix/forgejo-merged-cl…
7512411
…osed-list
@maria-rcks

maria-rcks commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

merged current main into the existing head without rebasing at e8866d0031ffa20e56edcd6e1b18bded0cde9d83. resolved the forgejo conflict by preserving main's mapped-state filtering and this pr's consumed-row budget and empty-slice continuation. the diff remains four files (+168/-6).

blacksmith vp run check:changed FETCH_HEAD against main e6e2ab05cceb3f8245e87f8499d4891f27de33cb passed format, lint, knip, graphql validation, typechecks for 11 affected packages, and 155 tests in four files. two independent scoped reviews approved this head without findings.

live forgejo-to-client verification was not repeated for this merge; the separate verification comment records the earlier real-provider run.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maria-rcks

maria-rcks commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head 7512411622a0a47bfe0a054bed3879cd3e5ea5b1 against github/main at 7195b699547b538e49f758e314dde5c8c5d907cf on a disposable linux vm. one dev server ran at a time, with separate state. used repository playwright and google chrome, actual forgejo 11.0.16 and tea 0.16.0, and a real repository containing one older closed-unmerged pr, 101 merged prs, and two open prs. no mocks. added the project through the web client and completed real codex gpt-6.1-sol turns on both servers.

captured the actual web client's pullRequests.list websocket responses:

                         main                       pr head
closed, first page       99 merged rows              0 rows, continuation offset 99
closed, load more        2 merged + 1 closed         only the closed pr
merged, two pages        101 merged + 1 closed       101 unique merged, no closed
open                                                both open prs
all, two pages                                      all 104 unique prs

additional authenticated websocket calls with limit=30 crossed three empty closed slices at offsets 30, 60 and 90, preserving the boundary. the fourth returned the older closed pr and ended pagination. open-pr details and the code tab also loaded.

closed still needs load more on the web client with this history. the fix removes wrong-state payloads and preserves continuation; it does not automatically exhaust the history.

blacksmith vp run check:changed FETCH_HEAD passed format, lint, knip, graphql validation, typechecks for 11 packages, and 154 tests in four files. no source edits, commits or pushes were needed.

server/client transcript

main, closed first page:

main closed first page, client hides 99 merged rows

pr head, same repository and closed first page:

pr closed first page, empty slice retains continuation

pr head, after clicking load more:

pr continuation reaches the older closed unmerged pull request

Not verified

native ios/android, electron shell, macos/windows, remote/relay/tunnel connections, the fj credential path, and other forgejo versions or slow external hosts. exercised the linux web client and the real forgejo/tea provider path.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maria-rcks
Merge remote-tracking branch 'github/main' into fix/forgejo-merged-cl…
e8866d0
…osed-list

# Conflicts:
#	packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts
juliusmarminge
juliusmarminge requested changes Nov 9, 2026
View reviewed changes

@juliusmarminge juliusmarminge left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the thorough pagination work! #24772 (cf4514d19f) already filters merged and closed rows on main. Please rebase and cut this down to the remaining bounded-scan and empty-slice continuation fix, which prevents a single request from walking an arbitrarily long history.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
only21mil and others added 3 commits November 9, 2026 23:03
@only21mil @claude
Merge remote-tracking branch 'upstream/main' into fix/forgejo-merged-…
20ef934
…closed-list

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
test(forgejo): drop list cases main's state filter already covers
09cfa0b
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil @claude
fix(forgejo): keep main's state filter comment and add the row budget…
5bbb14b
… to it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@only21mil

only21mil commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

Thanks, cut down in 5bbb14b. I merged current main (20ef934) instead of rebasing, since our contributor rule doesn't rewrite a pushed branch. The diff on top of main is now 4 files, +64/-5.

What's left:

  • The Forgejo list loop stops after limit rows read, kept or not (consumed < input.limit). Today it stops only when it has limit matches, so a Closed slice over a long merged history keeps reading until the history ends.
  • PullRequestService.nextListCursor returns a continuation for an empty slice whose host still read rows (cursorAdvance > 0). Without that, a bounded slice that kept nothing would end the list. An empty slice that read nothing still ends it.

#24772 covers the merged/closed filtering, so I dropped our provider tests for it. The row budget is now one assertion in #24772's own test, and the service keeps its three-row table. Both fail on main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@only21mil only21mil changed the title fix(forgejo): carry the list on from a slice that kept nothing fix(forgejo): Closed lists read long merged histories in bounded slices Nov 9, 2026
@only21mil only21mil closed this Nov 9, 2026
@only21mil only21mil reopened this Nov 9, 2026
@t3dotgg

t3dotgg commented Nov 12, 2026

Copy link
Copy Markdown
Member

Note

🤖 Claude Opus 5.5 responding on behalf of Theo

Closing. This PR has been open for more than 3 weeks, and main has moved a long way since then. If the change still matters, open a fresh PR from current main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@juliusmarminge juliusmarminge juliusmarminge requested changes
@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@only21mil @maria-rcks @t3dotgg @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.