improvement(confluence): expand scopes, persist canonical mode toggle#4461
improvement(confluence): expand scopes, persist canonical mode toggle#4461waleedlatif1 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds cursor-based pagination to the Confluence space selector API (including a transparent handoff from Persists canonical selector-vs-manual mode toggles in connector Reviewed by Cursor Bugbot for commit a677ae8. Configure here. |
Greptile SummaryThis PR expands the Confluence connector's OAuth scopes to cover granular v2 and CQL endpoints, adds cursor-based pagination for the spaces selector (including archived spaces), persists the canonical-pair mode toggle in
Confidence Score: 5/5Safe to merge — all changes are additive, well-guarded, and confined to the Confluence connector and its selector infrastructure. The pagination logic is correct: the compound cursor correctly transitions from current → archived spaces and terminates cleanly, the auto-drain effect is properly guarded against re-entrancy, and the !hasMore guard in the combobox prevents false missing-option states during draining. The canonical mode persistence is correctly scoped to _canonicalModes, excluded from user-editable keys, and the didCanonicalModesChange comparison correctly defaults absent keys to basic on both sides. The domain normalization refactoring fixes a latent double-protocol URL bug and is safe because getConfluenceCloudId already lowercases internally. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as SelectorCombobox
participant Q as useSelectorOptions
participant IQ as useInfiniteQuery
participant API as /api/tools/confluence/selector-spaces
C->>Q: useSelectorOptions('confluence.spaces')
Q->>IQ: enabled (supportsPagination=true)
IQ->>API: POST {cursor: undefined}
API-->>IQ: {spaces: [...], nextCursor: "current:abc"}
IQ-->>Q: page 1 items
Q-->>C: data=page1, hasMore=true
Note over Q: useEffect: hasNextPage && !isFetchingNextPage
Q->>IQ: fetchNextPage()
IQ->>API: POST {cursor: "current:abc"}
API-->>IQ: {spaces: [...], nextCursor: "archived:"}
IQ-->>Q: page 2 items
Q-->>C: data=page1+page2, hasMore=true
Q->>IQ: fetchNextPage()
IQ->>API: POST {cursor: "archived:"}
API-->>IQ: {spaces: [...archived...], nextCursor: undefined}
IQ-->>Q: archived items
Q-->>C: data=all pages, hasMore=false
Reviews (3): Last reviewed commit: "improvement(confluence): stream paginate..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2b1e223. Configure here.
Confluence v2 spaces endpoint caps at limit=250 per page. The selector endpoint was making one request and silently dropping every space past the first page, which is why some spaces only worked when entered as a manual spaceKey. Now follows _links.next cursor up to 20 pages (5000 spaces).
Confluence v2 /spaces defaults to status=current and the status param is a single-value enum, so archived spaces never surface. They synced fine when entered manually as a spaceKey because the connector looks up spaces via ?keys=<key> which ignores status. Now fetches current and archived in parallel and tags archived ones in the dropdown label.
Bake pagination support into the selector abstraction via an opt-in fetchPage definition so dropdowns populate progressively instead of blocking on a full page-walk. Confluence spaces now stream current then archived in a single cursor sequence.
|
@cursor review |
|
@greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a677ae8. Configure here.
…#4461) * improvement(confluence): expand scopes, persist canonical mode toggle * improvement(confluence): memoize persisted canonical modes parse * fix(confluence): paginate space selector dropdown Confluence v2 spaces endpoint caps at limit=250 per page. The selector endpoint was making one request and silently dropping every space past the first page, which is why some spaces only worked when entered as a manual spaceKey. Now follows _links.next cursor up to 20 pages (5000 spaces). * fix(confluence): include archived spaces in selector dropdown Confluence v2 /spaces defaults to status=current and the status param is a single-value enum, so archived spaces never surface. They synced fine when entered manually as a spaceKey because the connector looks up spaces via ?keys=<key> which ignores status. Now fetches current and archived in parallel and tags archived ones in the dropdown label. * improvement(confluence): stream paginated space selector results Bake pagination support into the selector abstraction via an opt-in fetchPage definition so dropdowns populate progressively instead of blocking on a full page-walk. Confluence spaces now stream current then archived in a single cursor sequence.
Summary
requiredScopesto cover granular v2 + CQL search endpoints (read:page:confluence,read:blogpost:confluence,read:space:confluence,read:label:confluence,search:confluence)source_config._canonicalModesso selector vs manual-input choice survives reloads in the edit modalnormalizeConfluenceDomainHosthelper across connector and tool utils (no duplication)pages→blogpostsso blogpost labels surface; lower concurrency to 5Type of Change
Testing
Tested manually — verified scope subset against
OAUTH_PROVIDERS.confluence, confirmed all prod credentials already have these scopes (no re-auth banner), verified mode persistence survives modal close/reopen.Checklist