Repository navigation
FOUR-33545 | Multi Transcript >> Remove Message Error in List Transcript - #9089
mcraeteisha wants to merge 1 commit into
Conversation
Persisted tokens created during rollback may not have a live engine attached. This change prevents inline service-task execution when no engine is available and instead queues the job. It also adds a regression test covering service tasks without an engine and fixes a couple of assertion comparisons in the rollback tests.
PR SummaryMedium Risk Overview
Tests: adds Reviewed by Cursor Bugbot for commit 50ced22. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
QA server K8S was successfully deployed https://tenant-1.ci-021bf76669.engk8s.processmaker.net |
eiresendez
left a comment
There was a problem hiding this comment.
The implementation is narrowly scoped and appears correct 👍





Issue
Ticket: FOUR-33545
Rollback on a request in
ERRORreturns500fromPOST /api/1.0/tasks/{task}/rollback. The log isCall to a member function getEngine() on nullinWorkflowManagerDefault::canRunInlineTask(). After a refresh, Rollback is gone and the request cannot be recovered from the summary.Rollback copies the previous closed service task with
replicate(), saves it asACTIVE, then callsWorkflowManager::runServiceTask()with that Eloquent token.canRunInlineTask()does$token->getInstance()->getEngine(). A token loaded from the database has no Nayra execution instance, sogetInstance()is null. The call throws before the request is set back toACTIVEand before the failing task is closed. The new active token is already saved, sogetErrorTask()no longer sees aFAILINGtoken and the summary hides Rollback.Solution
ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php, read the engine with$instance?->getEngine(). When the instance or engine is missing,canRunInlineTask()returns false andrunServiceTask()/runScripTask()queue the task.tests/unit/ProcessMaker/RollbackProcessRequestTest.php,testServiceTaskWithoutEngineIsQueuedasserts that a service token with no engine dispatchesRunServiceTask. The script and service rollback mocks now compareelement_idwith===instead of assigning it.How To Test
ERRORwhose latest token isFAILINGand whose previous closed element is a service task. The PDF Generator -> Send Email process is enough: complete the form so the gateway takes the Send Email path, and let Send Email fail./requests/{id}and choose Rollback.POST /api/1.0/tasks/{task}/rollbackreturns200, the request isACTIVE, and the summary still offers recovery if a later step fails.php vendor/bin/phpunit tests/unit/ProcessMaker/RollbackProcessRequestTest.phpand confirm all four tests pass.ci:deploy
Code Review Checklist