Skip to content

Commit

Permalink
[connectors] fix(Zendesk) - high volumes (#8975)
Browse files Browse the repository at this point in the history
* 🐛

* 🐛

* enh: interrupt ticket batching if a null nextLink is received

* fix: fix a typo

* misc: change the order in an AND
  • Loading branch information
aubin-tchoi authored Nov 27, 2024
1 parent be0566b commit adeb33c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions connectors/src/connectors/zendesk/lib/zendesk_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down Expand Up @@ -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,
};
}
Expand Down

0 comments on commit adeb33c

Please sign in to comment.