mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 03:02:56 +00:00
An Electron scenario stopped at the first failed or cancelled action and returned no record for the remaining declared actions, so normalized_result.actions could not account for the whole scenario. Record every remaining action as cancelled with a not-executed error, the representation browser scenarios already use. Both runners now share one helper for that error, which also distinguishes a stop caused by request cancellation from one caused by an action failure. Fixes #5943 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
591 B
TypeScript
15 lines
591 B
TypeScript
/** Status of the earlier action that stopped a declared scenario sequence. */
|
|
export type ScenarioActionStop = "failed" | "cancelled";
|
|
|
|
/**
|
|
* Explain a declared action recorded as `cancelled` without running because an
|
|
* earlier action stopped the sequence. Scenario producers record every
|
|
* remaining action so results account for the whole declared sequence.
|
|
*/
|
|
export const notExecutedActionError = (
|
|
stoppedBy: ScenarioActionStop,
|
|
): string =>
|
|
stoppedBy === "failed"
|
|
? "not executed after an earlier action failure"
|
|
: "not executed after scenario request cancellation";
|