fix(selectors): fetch all pages for paginated dropdown list routes#4823
Conversation
Dropdown selectors fetched only the first page of paginated provider APIs, silently hiding results past page one. Add bounded server-side draining to the list routes across Microsoft Graph, Google, Notion, Atlassian, Linear, AWS CloudWatch, and offset/token REST APIs, plus a shared client-side drain cap in the selector hook. Response shapes, stored values, and tool execution are unchanged; CloudWatch list tools still honor a caller-supplied limit. Also fixes the Word file picker that was searching for .xlsx files.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Server routes now drain pagination with per-integration caps and warn when a cap is hit (Microsoft Graph via Client: Reviewed by Cursor Bugbot for commit abdaf2c. Configure here. |
- JSM service-desk/request-type drains advance `start` by the actual row count returned (not the fixed page size) and stop on an empty page, so a short non-final page can't skip items. - Monday boards drain now checks `response.ok` per page, surfacing a mid-drain HTTP failure instead of treating it as an empty final page and returning a partial 200.
Greptile SummaryThis PR fixes a widespread first-page-only bug in dropdown selector routes by adding bounded server-side pagination draining across ~30 API routes (Microsoft Graph, Google APIs, Notion, Jira/JSM, Linear, Slack, Airtable, Asana, Zoom, Webflow, Wealthbox, Monday, Pipedrive, and more). It also introduces a shared
Confidence Score: 5/5Safe to merge. All pagination loops are bounded, warnings are emitted at caps, and the response shapes are backward-compatible. The change is additive: each route gets a bounded drain loop, shared utilities consolidate repeated patterns, and the client hook gains a truncated guard. The Word/Excel file-type fix is isolated to a single route with a new optional query param. No execution paths, stored IDs, or response contracts are broken. No files require special attention; the one suggestion in registry.ts is a quality improvement rather than a correctness issue. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Selector Dropdown] --> B{fetchPage defined?}
B -- yes --> C[useSelectorOptions fetchPage path]
B -- no --> D[useSelectorOptions fetchList path]
C --> E{pageCount >= 50?}
E -- no --> F[fetchNextPage auto-drain]
F --> G{hasNextPage?}
G -- yes --> F
G -- no --> H[Full option list]
E -- yes --> I[Stop + truncated=true + logger.warn]
D --> J[Single fetchList call]
J --> H
H --> K[Render Dropdown]
L[resolve-values / search-replace loadAllSelectorOptions] --> M{fetchList defined?}
M -- yes --> N[Call fetchList once]
M -- no --> O{fetchPage defined?}
O -- yes --> P[Drain fetchPage up to 50 pages]
O -- no --> Q[Return empty array]
N --> R[All options]
P --> R
Reviews (2): Last reviewed commit: "fix(selectors): drain fetchPage in direc..." | Re-trigger Greptile |
The offset-advancement fix (advance `start` by the rows returned, not the fixed page size) landed in 7b19788; update the TSDoc to match so it no longer reads as advancing by `limit`.
Making `fetchList` optional left three direct callers (outside the useSelectorOptions hook) calling it unguarded, which broke the build's type check. Route them through a shared `loadAllSelectorOptions` helper that uses `fetchList` when present and otherwise drains `fetchPage`. This also prevents a regression: `confluence.spaces` / `knowledge.documents` now paginate via `fetchPage` only, and these callers (search/replace, value resolution) would otherwise have silently returned no options.
|
@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 abdaf2c. Configure here.
Summary
slack.userstruncatedsignal in the selector hook, and removed a dead duplicate pagination path in the Confluence selector.xlsxfiles (the shared Microsoft files route couldn't distinguish Word from Excel)What does NOT change
fileType,offset) are optional and backwards-compatiblelimitis still honored as a hard capType of Change
Testing
Tested manually. Each pagination mechanism was validated against the providers' live API docs by independent review.
Checklist