Skip to content

Commit 597d408

Browse files
committed
fix(connectors): google-forms listingCapped must fire on slice regardless of hitLimit (404-null-filter gap)
1 parent 4d84cb6 commit 597d408

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,20 @@ export const googleFormsConnector: ConnectorConfig = {
600600

601601
/**
602602
* Mark the listing as incomplete so the sync engine skips deletion
603-
* reconciliation. This applies when the `maxForms` cap truncates results
604-
* while more forms exist (forms beyond the cap are not absent from the
605-
* source) or when a transient error caused a still-present form to be
606-
* dropped from this page — deleting those would wipe valid documents from
607-
* the knowledge base. When the cap merely coincides with source exhaustion
608-
* (no next page), reconciliation stays enabled so deleted forms are cleaned up.
603+
* reconciliation. Three cases drop still-existing forms from the listing:
604+
* - `slicedSome`: this page held more forms than the `maxForms` cap allowed,
605+
* so forms beyond the slice were truncated. This is independent of
606+
* `hitLimit`, which counts successfully fetched stubs and can fall below
607+
* the cap when 404s or errors null out items even though real forms were
608+
* sliced off.
609+
* - `hitLimit` with a next page: the cap was reached while more pages of
610+
* forms remain in the source.
611+
* - `skippedOnError`: a transient error dropped a still-present form.
612+
* Deleting any of those would wipe valid documents from the knowledge base.
613+
* When the cap merely coincides with source exhaustion (no slice, no next
614+
* page), reconciliation stays enabled so deleted forms are cleaned up.
609615
*/
610-
if (syncContext && ((hitLimit && (slicedSome || Boolean(nextPageToken))) || skippedOnError)) {
616+
if (syncContext && (slicedSome || (hitLimit && Boolean(nextPageToken)) || skippedOnError)) {
611617
syncContext.listingCapped = true
612618
}
613619

0 commit comments

Comments
 (0)