fix(tables): prevent legacy group auto-run dispatch (#6595)

This commit is contained in:
Theodore Li
2026-08-12 00:32:16 -04:00
committed by GitHub
parent eb26b42680
commit 9923fafe5e
2 changed files with 46 additions and 2 deletions
@@ -378,6 +378,28 @@ describe('workflow and enrichment Table application commands', () => {
)
})
it('does not start auto-run when the generic update saves a legacy enabled group', async () => {
await updateTableGroupUseCase.execute({
principal,
input: {
tableId: table.id,
workspaceId: table.workspaceId,
groupId: group.id,
autoRun: true,
},
})
expect(mocks.updateGroup).toHaveBeenCalledWith(
expect.objectContaining({
autoRun: true,
suppressAutoRunDispatch: true,
}),
'request-1'
)
expect(mocks.runDetached).not.toHaveBeenCalled()
expect(mocks.runWorkflowColumn).not.toHaveBeenCalled()
})
it('rejects an invalid output before constructing or mutating the group', async () => {
await expect(
createWorkflowTableGroup.execute({
@@ -513,6 +535,28 @@ describe('workflow and enrichment Table application commands', () => {
expect(mocks.signal).not.toHaveBeenCalled()
})
it('does not start auto-run when the workflow update saves a legacy enabled group', async () => {
await updateWorkflowTableGroup.execute({
principal,
input: {
tableId: table.id,
workspaceId: table.workspaceId,
groupId: group.id,
autoRun: true,
},
})
expect(mocks.updateGroup).toHaveBeenCalledWith(
expect.objectContaining({
autoRun: true,
suppressAutoRunDispatch: true,
}),
'request-1'
)
expect(mocks.runDetached).not.toHaveBeenCalled()
expect(mocks.runWorkflowColumn).not.toHaveBeenCalled()
})
it('passes authorized output type and ordering to the add-output mutation', async () => {
await addWorkflowTableGroupOutput.execute({
principal,
+2 -2
View File
@@ -635,7 +635,7 @@ export const updateTableGroupUseCase = defineAuthorizedTableUseCase({
changed:
JSON.stringify(context.table.schema) !== JSON.stringify(table.schema) ||
JSON.stringify(context.table.metadata) !== JSON.stringify(table.metadata),
startAutoRun: previousGroup?.autoRun !== true && input.autoRun === true,
startAutoRun: previousGroup?.autoRun === false && input.autoRun === true,
actorUserId,
}
},
@@ -824,7 +824,7 @@ export const updateWorkflowTableGroup = defineAuthorizedTableUseCase({
changed:
JSON.stringify(context.table.schema) !== JSON.stringify(table.schema) ||
JSON.stringify(context.table.metadata) !== JSON.stringify(table.metadata),
startAutoRun: previousGroup.autoRun !== true && input.autoRun === true,
startAutoRun: previousGroup.autoRun === false && input.autoRun === true,
actorUserId,
}
},