Skip to content

Commit 3072823

Browse files
waleedlatif1claude
andcommitted
fix(ashby): gate operation-specific param mappings to prevent stale overwrites
Multiple subBlocks share the same target tool param (createdAt is set by appCreatedAt/candidateCreatedAt/noteCreatedAt; candidateId by appCandidateId/ filterCandidateId). Because subBlock values persist across operation switches, a stale value from a prior operation could silently overwrite the correct one. Guard each mapping with an explicit operation check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9bb00f4 commit 3072823

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

apps/sim/blocks/blocks/ashby.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,9 @@ Output only the ISO 8601 timestamp string, nothing else.`,
719719
if (params.searchEmail) result.email = params.searchEmail
720720
if (params.filterStatus) result.status = params.filterStatus
721721
if (params.filterJobId) result.jobId = params.filterJobId
722-
if (params.filterCandidateId) result.candidateId = params.filterCandidateId
722+
if (params.operation === 'list_applications' && params.filterCandidateId) {
723+
result.candidateId = params.filterCandidateId
724+
}
723725
if (params.jobStatus) result.status = params.jobStatus
724726
if (params.sendNotifications === 'true' || params.sendNotifications === true) {
725727
result.sendNotifications = true
@@ -739,10 +741,21 @@ Output only the ISO 8601 timestamp string, nothing else.`,
739741
if (params.expandJob === 'true' || params.expandJob === true) {
740742
result.expandJob = true
741743
}
742-
if (params.appCandidateId) result.candidateId = params.appCandidateId
743-
if (params.appCreatedAt) result.createdAt = params.appCreatedAt
744-
if (params.candidateCreatedAt) result.createdAt = params.candidateCreatedAt
745-
if (params.noteCreatedAt) result.createdAt = params.noteCreatedAt
744+
if (params.operation === 'create_application' && params.appCandidateId) {
745+
result.candidateId = params.appCandidateId
746+
}
747+
if (params.operation === 'create_application' && params.appCreatedAt) {
748+
result.createdAt = params.appCreatedAt
749+
}
750+
if (
751+
(params.operation === 'create_candidate' || params.operation === 'update_candidate') &&
752+
params.candidateCreatedAt
753+
) {
754+
result.createdAt = params.candidateCreatedAt
755+
}
756+
if (params.operation === 'create_note' && params.noteCreatedAt) {
757+
result.createdAt = params.noteCreatedAt
758+
}
746759
if (params.updateName) result.name = params.updateName
747760
if (params.website) result.website = params.website
748761
if (params.alternateEmail) result.alternateEmail = params.alternateEmail

0 commit comments

Comments
 (0)