Skip to content

Commit 2036524

Browse files
committed
fix(circleback): reject a zero sync cap that would coerce to unlimited
1 parent 2afda0e commit 2036524

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/sim/connectors/circleback/circleback.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('circleback connector request shaping and documents', () => {
218218
})
219219

220220
it('rejects caps that the parser would silently treat as unlimited', async () => {
221-
for (const bad of ['0.5', 'Infinity', '-1', 'abc']) {
221+
for (const bad of ['0', '0.5', 'Infinity', '-1', 'abc']) {
222222
const result = await circlebackConnector.validateConfig('tok', { maxMeetings: bad })
223223
expect(result.valid).toBe(false)
224224
}

apps/sim/connectors/circleback/circleback.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,11 @@ export const circlebackConnector: ConnectorConfig = {
426426
sourceConfig: Record<string, unknown>
427427
): Promise<{ valid: boolean; error?: string }> => {
428428
const maxMeetings = sourceConfig.maxMeetings as string | undefined
429-
if (maxMeetings && (!Number.isInteger(Number(maxMeetings)) || Number(maxMeetings) < 0)) {
430-
return { valid: false, error: 'Max meetings must be a non-negative whole number' }
429+
if (maxMeetings && (!Number.isInteger(Number(maxMeetings)) || Number(maxMeetings) < 1)) {
430+
return {
431+
valid: false,
432+
error: 'Max meetings must be a positive whole number, or blank to sync all meetings',
433+
}
431434
}
432435

433436
const ownership = sourceConfig.ownership

0 commit comments

Comments
 (0)