FOUR-28073 Canceled case still progresses to Completed#8801
FOUR-28073 Canceled case still progresses to Completed#8801
Conversation
Description: Race: cancel closed only in-memory tokens while parallel gateways could create new ACTIVE tokens afterward; completing them overwrote CANCELED with COMPLETED. Bulk-close stray tokens on cancel, block task completion and new activations when status is CANCELED, skip COMPLETED persistence if already canceled, guard script completion, and rethrow HttpResponseException from BPMN actions so 422 responses are not swallowed as request errors. Related tickets: https://processmaker.atlassian.net/browse/FOUR-28073
|
|
QA server K8S was successfully deployed https://ci-778d7fdf17.engk8s.processmaker.net |
| if ($this->processId !== 'non_persistent_process') { | ||
| HandleRedirectListener::sendRedirectToEvent(); | ||
| } | ||
| } catch (HttpResponseException $exception) { |
|
|
||
| $response = $script->runScript($data, $configuration, $token->getId(), $errorHandling->timeout()); | ||
|
|
||
| if (ProcessRequest::query()->whereKey($instance->getKey())->value('status') === 'CANCELED') { |
There was a problem hiding this comment.
@gproly Not sure if this is needed, because completeTask verifies that the token is ACTIVE. Could you try to remove this code?
| WorkflowManager::completeTask($processModel, $instance, $token, $response['output']); | ||
| } catch (ConfigurationException $exception) { | ||
| $output = $exception->getMessageForData($token); | ||
| if (ProcessRequest::query()->whereKey($instance->getKey())->value('status') === 'CANCELED') { |
There was a problem hiding this comment.
@gproly Not sure if this is needed, because completeTask verifies that the token is ACTIVE. Could you try to remove this code?
| //Validate data | ||
| $element = $token->getDefinition(true); | ||
| $this->validateData($data, $definitions, $element); | ||
| if ($instance instanceof ProcessRequest) { |
There was a problem hiding this comment.
@gproly Not sure if this is needed, because CompleteActivity should verify that the token is ACTIVE. Could you check if this verification could go to the Job?





Description:
Race: cancel closed only in-memory tokens while parallel gateways could
create new ACTIVE tokens afterward; completing them overwrote CANCELED
with COMPLETED. Bulk-close stray tokens on cancel, block task completion
and new activations when status is CANCELED, skip COMPLETED persistence
if already canceled, guard script completion, and rethrow HttpResponseException
from BPMN actions so 422 responses are not swallowed as request errors.
Related tickets:
https://processmaker.atlassian.net/browse/FOUR-28073
ci:deploy