Skip to content

Return tasks in RetryProcess

https://redmine.teklia.com/issues/11797

In the frontend, in the process status page, clicking on ActionsRetry process then confirming the action should retry the process then switch to the newly created run. The frontend has always had everything set up to do this: the store calls RetryProcess and stores the result both in the Ponos (tasks) and process stores, then the component calls a $router.push to force the switch to the latest run.

This used to work until we removed the concept of Workflow in !2008 (merged). It used to sit between a process and its tasks and RetrieveWorkflow was used to list tasks in the frontend. That has since moved to RetrieveProcess, which isn't called automatically after a retry. It cannot be called automatically after a retry, because that will result in a stale read where the newly created tasks are still not found, so the redirection will still not work.

Since RetryProcess is creating tasks, it already has fetched tasks from the database. We can have it return the tasks just like RetrieveProcess by switching its response from a ProcessSerializer to a ProcessDetailsSerializer. This change should cause 0 additional SQL queries.