Skip to content

Commit

Permalink
[connectors] Fix(Zendesk) - users not found (#8912)
Browse files Browse the repository at this point in the history
* fix: fix issues with users not found by the SDK

* fix: ignore issues with users not found by the SDK

* 🔊
  • Loading branch information
aubin-tchoi authored Nov 26, 2024
1 parent e762f86 commit 635eafc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion connectors/src/connectors/zendesk/lib/sync_ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,16 @@ ${metadata}
Conversation:
${comments
.map((comment) => {
const author = users.find((user) => user.id === comment.author_id);
let author;
try {
author = users.find((user) => user.id === comment.author_id);
} catch (e) {
logger.warn(
{ connectorId, e, ...loggerArgs },
"[Zendesk] Error finding the author of a comment."
);
author = null;
}
return `
[${new Date(Number(comment?.created_at)).toISOString()}] ${
author ? `${author.name} (${author.email})` : "Unknown User"
Expand Down
2 changes: 1 addition & 1 deletion connectors/src/connectors/zendesk/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export async function syncZendeskTicketBatchActivity({
return { hasMore: false, nextLink: "" };
}

const users = await zendeskApiClient.users.list();
const users = (await zendeskApiClient.users.list()) || [];

const comments = await concurrentExecutor(
tickets,
Expand Down

0 comments on commit 635eafc

Please sign in to comment.