Skip to content

Commit 412217f

Browse files
committed
fix(connectors): only flag Meet listing capped when cap truncates source
Previously listingCapped was set whenever the fetched count reached maxMeetings, even when the API returned every record and no next page existed. That suppressed the sync engine's deletion reconciliation when the cap happened to equal the true source size. Now flag only when more pages remain or records were dropped from the page.
1 parent 1291db0 commit 412217f

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

apps/sim/connectors/google-meet/google-meet.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,17 @@ export const googleMeetConnector: ConnectorConfig = {
385385

386386
const totalFetched = prevFetched + documents.length
387387
if (syncContext) syncContext.totalDocsFetched = totalFetched
388-
const hitLimit = maxMeetings > 0 && totalFetched >= maxMeetings
389-
if (hitLimit && syncContext) syncContext.listingCapped = true
388+
const reachedCap = maxMeetings > 0 && totalFetched >= maxMeetings
390389

391-
const hasMore = !hitLimit && Boolean(nextPageToken)
390+
// Only flag the listing as capped when the cap actually truncated a larger source —
391+
// either more pages remain, or records were dropped from this page. If the source
392+
// was fully listed and merely happens to equal the cap, leave it unflagged so the
393+
// sync engine still reconciles deletions of meetings that disappear upstream.
394+
const truncated =
395+
reachedCap && (Boolean(nextPageToken) || allDocuments.length > documents.length)
396+
if (truncated && syncContext) syncContext.listingCapped = true
397+
398+
const hasMore = !reachedCap && Boolean(nextPageToken)
392399

393400
return {
394401
documents,

0 commit comments

Comments
 (0)