Skip to content

Refactor the workflow polling to refresh the process

Erwan Rouchet requested to merge process-polling into master

Closes #788 (closed)

I could not find any single way to reproduce the case where the View element button would not show up when coming from the process list page, neither in prod, in preprod or locally.

For the second case: the button uses process.element, but the process is never fetched again since it is not expected to change in the duration of the workflow. Since the import task now sets process.element while it runs, the polling system needs to detect when the process might have changed: we'll just assume it can change when the state of the workflow changes.

The polling code was refactored to be able to access the process by ID instead of only having the URL of the current workflow. The process is fetched again when we already have fetched the workflow once and its state changed. That way, when the workflow gets a completed state, the process gets updated and a process.element is available, so the button shows up.

Edited by Erwan Rouchet

Merge request reports

Loading