Skip to content

Commit b3c191b

Browse files
fix: truncate zoom meeting agenda (calcom#22137)
* fix truncate zoom agenda * type error --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
1 parent 0b977e6 commit b3c191b

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/app-store/zoomvideo/lib/VideoApiAdapter.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
155155
};
156156
};
157157

158+
// Zoom agenda field has a 2000 character limit; we set maxLength to 1900 to leave a safety buffer
159+
const truncateAgenda = (description?: string | null) => {
160+
if (!description) return description;
161+
162+
const maxLength = 1900;
163+
const trimmed = description.trimEnd();
164+
if (trimmed.length > maxLength) {
165+
return `${trimmed.substring(0, maxLength).trimEnd()}...`;
166+
}
167+
return trimmed;
168+
};
169+
158170
const userSettings = await getUserSettings();
159171
const recurrence = getRecurrence(event);
160172
// Documentation at: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate
@@ -166,7 +178,7 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
166178
//schedule_for: "string", TODO: Used when scheduling the meeting for someone else (needed?)
167179
timezone: event.organizer.timeZone,
168180
password: userSettings?.schedule_meeting?.default_password_for_scheduled_meetings ?? undefined,
169-
agenda: event.description,
181+
agenda: truncateAgenda(event.description),
170182
settings: {
171183
host_video: true,
172184
participant_video: true,

0 commit comments

Comments
 (0)