Skip to content

Commit c0b76c2

Browse files
committed
fix(peopledatalabs): scope shared fields (profile/location/name/website) per operation
The block has subBlocks whose raw IDs collide with PDL API param names (profile, location for person; name, website for company). Their values persist across operation switches even though the UI hides them, so a person LinkedIn URL could leak into a Company Enrich request, etc. Reset these shared targets and repopulate them only from inputs that belong to the active operation. Addresses Greptile P1 review on PR #4513.
1 parent f2a3c9f commit c0b76c2

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

apps/sim/blocks/blocks/peopledatalabs.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,13 +432,31 @@ export const PeopleDataLabsBlock: BlockConfig<PdlPersonEnrichResponse> = {
432432
result.school_website = undefined
433433
result.school_profile = undefined
434434

435-
// Company Enrich uses company_* aliases for shared fields (profile, location)
435+
// Clear shared target fields and repopulate them per-operation. The raw
436+
// `profile`/`location`/`name`/`website` subBlocks are scoped to specific
437+
// operations in the UI, but their values persist when the user switches
438+
// operations — without this reset, e.g. a person LinkedIn URL would
439+
// leak into a Company Enrich request as the company profile.
440+
result.profile = undefined
441+
result.location = undefined
442+
result.name = undefined
443+
result.website = undefined
444+
445+
if (op === 'pdl_person_enrich' || op === 'pdl_person_identify') {
446+
if (params.profile !== undefined) result.profile = params.profile
447+
}
448+
if (op === 'pdl_person_enrich') {
449+
if (params.location !== undefined) result.location = params.location
450+
}
436451
if (op === 'pdl_company_enrich') {
452+
if (params.name !== undefined) result.name = params.name
453+
if (params.website !== undefined) result.website = params.website
437454
if (params.company_profile !== undefined) result.profile = params.company_profile
438455
if (params.company_location !== undefined) result.location = params.company_location
439456
}
440-
// Company Cleaner only accepts profile (LinkedIn URL) of the company aliases
441457
if (op === 'pdl_clean_company') {
458+
if (params.name !== undefined) result.name = params.name
459+
if (params.website !== undefined) result.website = params.website
442460
if (params.company_profile !== undefined) result.profile = params.company_profile
443461
}
444462

0 commit comments

Comments
 (0)