From b3c191b55329c54354458efcb538b9b32dfa6b91 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:15:13 +0530 Subject: [PATCH] fix: truncate zoom meeting agenda (#22137) * fix truncate zoom agenda * type error --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> --- .../app-store/zoomvideo/lib/VideoApiAdapter.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts index 86249e30dd..3b1595faaf 100644 --- a/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts +++ b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts @@ -155,6 +155,18 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter => }; }; + // Zoom agenda field has a 2000 character limit; we set maxLength to 1900 to leave a safety buffer + const truncateAgenda = (description?: string | null) => { + if (!description) return description; + + const maxLength = 1900; + const trimmed = description.trimEnd(); + if (trimmed.length > maxLength) { + return `${trimmed.substring(0, maxLength).trimEnd()}...`; + } + return trimmed; + }; + const userSettings = await getUserSettings(); const recurrence = getRecurrence(event); // Documentation at: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate @@ -166,7 +178,7 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter => //schedule_for: "string", TODO: Used when scheduling the meeting for someone else (needed?) timezone: event.organizer.timeZone, password: userSettings?.schedule_meeting?.default_password_for_scheduled_meetings ?? undefined, - agenda: event.description, + agenda: truncateAgenda(event.description), settings: { host_video: true, participant_video: true,