-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix timeout errors causing step history to be lost. #16259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix timeout errors causing step history to be lost. #16259
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
…synchronously-and-timeouts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures intermediate automation step results are retained and returned when an automation run times out.
- Introduce a
_stepResults
buffer onAutomationContext
and inOrchestrator
to accumulate step outputs. - Refactor timeout handling to use
helpers.withTimeout
and append buffered results after timeout. - Add comprehensive tests for various timeout and nested-trigger scenarios.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/server/src/threads/automation.ts | Add _stepResults handling, refactor timeout logic, update branch step behavior |
packages/server/src/definitions/automations.ts | Add _stepResults to AutomationContext interface |
packages/server/src/automations/tests/steps/triggerAutomationRun.spec.ts | Add tests covering step-history preservation on timeouts |
Comments suppressed due to low confidence (2)
packages/server/src/threads/automation.ts:34
- The code references
helpers.withTimeout
, buthelpers
is not imported. Addhelpers
to the import from@budibase/backend-core
to avoid runtime errors.
import { context, logging, configs } from "@budibase/backend-core"
packages/server/src/threads/automation.ts:352
- Calling
span.addTags
without checking ifspan
is defined may throw an error. Consider usingspan?.addTags
or guarding againstundefined
.
span.addTags({ timeout: true })
…utomation-actions-run-asynchronously-and-timeouts
…synchronously-and-timeouts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the tests!
…synchronously-and-timeouts
Description
If an automation times out, we never appended the step results to the automation results causing it to look like the automation didn't do anything. This PR fixes that by keeping track of intermediate results and using them if the automation times out.
Launchcontrol
No longer loses automation step history if the automation times out.