mirror of
https://github.com/sasjs/server.git
synced 2026-07-23 21:25:29 +00:00
4858245372
For JS/PY/R, processProgram sets session.state = failed (with failureReason) itself when the interpreter process exits non-zero, without throwing. ExecutionController.executeProgram then unconditionally set session.state = completed right after processProgram returned, silently overwriting that - so anything downstream inspecting session.state (e.g. scheduleSessionDestroy's expiresAfterMins branch) would see a crashed session mis-reported as successful. Guard the assignment so a failed state is never overwritten. No effect on SAS, which sets state independently via its own spawned process lifecycle. Added Execution.spec.ts covering both the failure case (state stays failed) and the success case (state still becomes completed), to guard against regressing in either direction.