Repository navigation
fix(github): fence repository pagination to selected connection (#48) - #27486
teamleaderleo wants to merge 8 commits into
Conversation
… query and policy
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
…st route stays off
|
Review (codex gpt-6-astra high, next-review): BLOCK at f64da62
|
|
Orphaned: no activity for 21 h, and no lane holds a lease on it. The orphan sweep could not merge |
|
Owned by an agent session · session |
|
Closing as superseded: #27025 (merged) binds the repository cursor to the caller's connection and query and filters each page by current policy (the #48 account-switching case), and #27828 (merged) covers write-token grants. This branch is about 2,200 commits behind with conflicts in all three integration files, and its exact-head review BLOCKed (VM write tokens refused). No owner session is recorded on it. Reopen on current base if a gap remains. |
Changelog
Fixed: An interrupted GitHub repository listing can no longer advance its cursor onto a different installation when connections are added, revoked, reordered, or rescoped.
Change
{installation, page}cursors with bounded v2 opaque cursors encoding an exact selectedconnectionId, page, and SHA-256 fence.409 cursor_staleand requests a fresh list.request.invalidfor malformed cursors.Regression
The first commit (
dcbc9b820e3e97e558c50e7d8d2c3b76e26a4cd1) addsbackend/apps/api/test/github-repos-cursor.test.ts: same-connection next page, next exact installation, changed order/revoke/insert, different principal/query/policy, invalid/oversized legacy cursors, and no connections. It initially fails to import the missing helper. The implementation is the next commit. Runcd backend && bun --filter @cmux/api test -- github-repos-cursor(or the matching backend Vitest invocation).Observed / Not run
Observed in #27025 head
cbbf1f3ca66063543866aa4bcdc4194686e7951e: the repo cursor used a numeric position inObject.values(state.connections); revocation/reordering can select another account mid-pagination. This PR is stacked on #27025 for an isolated review and changes two files. Live provider calls, deployment and account mutations were untouched. Local backend Vitest/TS typecheck are unavailable here; CI checks are the verification gate.Related: cmux-platform issue #48. Stable account-aware resource-selection projection across the platform API remains with #48’s existing owner lane.
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes GitHub repository pagination so an interrupted listing can no longer silently switch to a different connection when connections are added, revoked, reordered, or rescoped.
{installation, page}cursors with v2 opaque cursors that carry the exact selectedconnectionId, page, and a fence hash of the principal, query, policy, and ordered connection list.409 cursor_stalewhen the fence changes, and400 request.invalidfor legacy or malformed cursors; clients already handlerequest.invalid.ConnectionDOpaging method directly (the public route stays off in the test deployment) and verifies a stale cursor is refused before any further upstream call.Written for commit f64da62. Summary will update on new commits.