Skip to content

Commit 9f86e74

Browse files
committed
fix(peopledatalabs): scope size to search and autocomplete operations
`size` is shared by the person/company search subBlock and the autocomplete_size alias. The previous logic still forwarded a stale search `size` to operations that don't accept it (e.g. enrich, clean, identify), and the autocomplete branch only cleared it when autocomplete_size was unset. Reset `size` up front and only repopulate it for the three operations that actually accept it. Found via final integration audit of PR #4513.
1 parent c0b76c2 commit 9f86e74

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

apps/sim/blocks/blocks/peopledatalabs.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,17 @@ export const PeopleDataLabsBlock: BlockConfig<PdlPersonEnrichResponse> = {
460460
if (params.company_profile !== undefined) result.profile = params.company_profile
461461
}
462462

463-
// Autocomplete: use autocomplete_size, ignore stale search size
463+
// `size` is shared by search and autocomplete subBlocks; reset and
464+
// repopulate per-operation so a stale search size can't bleed into an
465+
// autocomplete request (or vice versa) or into operations that don't
466+
// accept `size` at all.
467+
result.size = undefined
464468
if (op === 'pdl_autocomplete') {
465469
if (params.autocomplete_size !== undefined) {
466470
result.size = Number(params.autocomplete_size)
467-
} else {
468-
result.size = undefined
469471
}
470-
} else if (params.size !== undefined) {
471-
result.size = Number(params.size)
472+
} else if (op === 'pdl_person_search' || op === 'pdl_company_search') {
473+
if (params.size !== undefined) result.size = Number(params.size)
472474
}
473475

474476
// min_likelihood is only honored by enrich endpoints

0 commit comments

Comments
 (0)