Skip to content

FOUR-28073 Canceled case still progresses to Completed#8801

Open
gproly wants to merge 3 commits intodevelopfrom
bugfix/FOUR-28073
Open

FOUR-28073 Canceled case still progresses to Completed#8801
gproly wants to merge 3 commits intodevelopfrom
bugfix/FOUR-28073

Conversation

@gproly
Copy link
Copy Markdown
Contributor

@gproly gproly commented Apr 28, 2026

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

gproly added 3 commits April 28, 2026 14:40
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
@processmaker-sonarqube
Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@Kookster310
Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://ci-778d7fdf17.engk8s.processmaker.net

@gproly gproly requested a review from caleeli April 29, 2026 20:30
if ($this->processId !== 'non_persistent_process') {
HandleRedirectListener::sendRedirectToEvent();
}
} catch (HttpResponseException $exception) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gproly Why this change is needed?


$response = $script->runScript($data, $configuration, $token->getId(), $errorHandling->timeout());

if (ProcessRequest::query()->whereKey($instance->getKey())->value('status') === 'CANCELED') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants