File tree Expand file tree Collapse file tree
apps/sim/app/api/tools/jsm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,9 +30,12 @@ interface JsmRequestTypeValue {
3030
3131/**
3232 * Drains the offset-paginated JSM `/servicedesk/{id}/requesttype` endpoint,
33- * advancing `start` by `limit` until `isLastPage === true` (or `_links.next` is
34- * absent). Bounded by `MAX_JSM_REQUEST_TYPES_PAGES`; emits a `logger.warn` and
35- * returns the partial set rather than looping unbounded when the cap is hit.
33+ * advancing `start` by the number of rows actually returned until
34+ * `isLastPage === true` (or `_links.next` is absent, or a page comes back
35+ * empty). Advancing by the real row count — not the requested `limit` —
36+ * prevents skipping items if the server returns a short non-final page. Bounded
37+ * by `MAX_JSM_REQUEST_TYPES_PAGES`; emits a `logger.warn` and returns the
38+ * partial set rather than looping unbounded when the cap is hit.
3639 */
3740async function fetchAllJsmRequestTypes (
3841 requestTypeUrl : string ,
Original file line number Diff line number Diff line change @@ -30,9 +30,12 @@ interface JsmServiceDeskValue {
3030
3131/**
3232 * Drains the offset-paginated JSM `/servicedesk` endpoint, advancing `start` by
33- * `limit` until `isLastPage === true` (or `_links.next` is absent). Bounded by
34- * `MAX_JSM_SERVICE_DESKS_PAGES`; emits a `logger.warn` and returns the partial
35- * set rather than looping unbounded when the cap is hit.
33+ * the number of rows actually returned until `isLastPage === true` (or
34+ * `_links.next` is absent, or a page comes back empty). Advancing by the real
35+ * row count — not the requested `limit` — prevents skipping items if the server
36+ * returns a short non-final page. Bounded by `MAX_JSM_SERVICE_DESKS_PAGES`;
37+ * emits a `logger.warn` and returns the partial set rather than looping
38+ * unbounded when the cap is hit.
3639 */
3740async function fetchAllJsmServiceDesks (
3841 baseUrl : string ,
You can’t perform that action at this time.
0 commit comments