From adeb33c5e83b1e997d098798e52e2ca2e785e026 Mon Sep 17 00:00:00 2001 From: Aubin <60398825+aubin-tchoi@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:21:48 +0100 Subject: [PATCH] [connectors] fix(Zendesk) - high volumes (#8975) * :bug: * :bug: * enh: interrupt ticket batching if a null nextLink is received * fix: fix a typo * misc: change the order in an AND --- connectors/src/connectors/zendesk/lib/zendesk_api.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/connectors/src/connectors/zendesk/lib/zendesk_api.ts b/connectors/src/connectors/zendesk/lib/zendesk_api.ts index 3ea817f0b161..97c0a73972a0 100644 --- a/connectors/src/connectors/zendesk/lib/zendesk_api.ts +++ b/connectors/src/connectors/zendesk/lib/zendesk_api.ts @@ -231,7 +231,7 @@ export async function fetchRecentlyUpdatedArticles({ }); return { articles: response.articles, - hasMore: response.next_page !== null || response.articles.length === 0, + hasMore: response.next_page !== null && response.articles.length !== 0, endTime: response.end_time, }; } @@ -292,7 +292,10 @@ export async function fetchRecentlyUpdatedTickets( }); return { tickets: response.tickets, - hasMore: !response.end_of_stream, + hasMore: + !response.end_of_stream && + response.after_url !== null && + response.tickets.length !== 0, nextLink: response.after_url, }; }