Bug Description
🧩 Test case
src/lib/__tests__/chain-service.test.ts > ChainService - Edge Cases & Errors > should ignore cancelExecution when already cancelled
📍 Suspected Root Cause
cancelExecution() does not persist the status update back to the database.
getExecution() might return undefined because the execution was never stored.
- The test setup might not create and save the execution object before invoking
cancelExecution().
Steps to Reproduce
- Create a mock execution with
status: "cancelled".
- Call
cancelExecution(execution.id) again.
- Call
getExecution(execution.id) afterward.
- Observe that
result?.status is undefined instead of "cancelled".
Expected Behavior
When calling cancelExecution() on an execution with status = "cancelled", the service should:
- Not throw any errors.
- Keep the status as
"cancelled".
- Return a valid execution object when
getExecution() is called.
Actual Behavior
expected undefined to be 'cancelled'
Environment
Vitest/ui v4.0.5
Vitest/coverage-v8 v4.0.4
Node.js v22.2.0
OS: Windows 11
File: src/lib/chain-service.ts
Test file: chain-service.test.ts
Screenshots
Additional Context
Bug Description
🧩 Test case
src/lib/__tests__/chain-service.test.ts > ChainService - Edge Cases & Errors > should ignore cancelExecution when already cancelled📍 Suspected Root Cause
cancelExecution()does not persist the status update back to the database.getExecution()might returnundefinedbecause the execution was never stored.cancelExecution().Steps to Reproduce
status: "cancelled".cancelExecution(execution.id)again.getExecution(execution.id)afterward.result?.statusisundefinedinstead of"cancelled".Expected Behavior
When calling
cancelExecution()on an execution withstatus = "cancelled", the service should:"cancelled".getExecution()is called.Actual Behavior
expected undefined to be 'cancelled'
Environment
Vitest/ui v4.0.5
Vitest/coverage-v8 v4.0.4
Node.js v22.2.0
OS: Windows 11
File: src/lib/chain-service.ts
Test file: chain-service.test.ts
Screenshots
Additional Context