From ed27b64eb48e8a555c947eff31013c8af90c27aa Mon Sep 17 00:00:00 2001 From: Ben Senescu <44480372+bensenescu@users.noreply.github.com> Date: Thu, 16 Apr 2026 16:24:27 -0400 Subject: [PATCH] fix: pass only required fields in workflow billingCustomer params (#123) The callers of startAudit and beginRankCheckRun were forwarding the incoming billingCustomer object directly into workflow.create params. At runtime the object can be an EnsuredUserContext with extra fields beyond BillingCustomerContext, which pollutes the workflow instance's persisted params payload. Explicitly pick the four required fields so only the intended data is serialized into the workflow. --- src/server/features/audit/services/AuditService.ts | 7 ++++++- .../features/rank-tracking/services/rankCheckRunGuards.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/server/features/audit/services/AuditService.ts b/src/server/features/audit/services/AuditService.ts index 1e29d22..7023e9e 100644 --- a/src/server/features/audit/services/AuditService.ts +++ b/src/server/features/audit/services/AuditService.ts @@ -58,7 +58,12 @@ async function startAudit(input: { id: auditId, params: { auditId, - billingCustomer: input.billingCustomer, + billingCustomer: { + userId: input.billingCustomer.userId, + userEmail: input.billingCustomer.userEmail, + organizationId: input.billingCustomer.organizationId, + projectId: input.billingCustomer.projectId, + }, projectId: input.projectId, startUrl, config, diff --git a/src/server/features/rank-tracking/services/rankCheckRunGuards.ts b/src/server/features/rank-tracking/services/rankCheckRunGuards.ts index d362e21..a2c795a 100644 --- a/src/server/features/rank-tracking/services/rankCheckRunGuards.ts +++ b/src/server/features/rank-tracking/services/rankCheckRunGuards.ts @@ -116,7 +116,12 @@ export async function beginRankCheckRun(input: { params: { runId, configId: input.config.id, - billingCustomer: input.billingCustomer, + billingCustomer: { + userId: input.billingCustomer.userId, + userEmail: input.billingCustomer.userEmail, + organizationId: input.billingCustomer.organizationId, + projectId: input.billingCustomer.projectId, + }, projectId: input.projectId, domain: input.config.domain, locationCode: input.config.locationCode,