FOUR-32144: Improve the api PUT /api/1.0/tasks/{task-id} - #9045
Conversation
Introduce PUT /api/1.1/tasks/{id} for COMPLETED status, gated by
TASK_UPDATE_V1_1_ENABLED, with optional raw token persistence behind
TOKEN_PERSISTENCE_RAW_ENABLED.
https://processmaker.atlassian.net/browse/FOUR-32800
feat(FOUR-32801): improve Jobs execution when the PUT tasks endpoint is executed
feat(FOUR-32800): add v1.1 task completion endpoint with raw SQL path
PR SummaryHigh Risk Overview Completion uses raw SQL reads ( Indexed search: Queue: Reviewed by Cursor Bugbot for commit daafb12. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 5 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
| 'completed_at', | ||
| 'token_properties', | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Raw save skips completion timestamp
High Severity
Raw token updates skip ProcessRequestTokenObserver, so completed_at_ms is never set. After persist, BpmnSubscriber calls diffInMilliseconds on that null value and task completion fails whenever token_persistence_raw_enabled is on.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
| if (array_key_exists($field, $instance->getDirty())) { | ||
| $payload[$field] = $instance->getAttributes()[$field]; | ||
| } | ||
| } |
There was a problem hiding this comment.
Raw persist drops signal events
High Severity
The raw persistInstanceUpdated path only writes status, last_stage_id, last_stage_name, progress, and completed_at. signal_events from updateCatchEvents never reaches the database, so signal and boundary catch events can miss incoming signals.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
|
|
||
| $this->runUpdate('process_requests', (int) $instance->getKey(), $payload); | ||
| $instance->syncChanges(); | ||
| } |
There was a problem hiding this comment.
Raw persist skips case title
Medium Severity
Raw instance updates skip ProcessRequestObserver::saving, so case_title and case_title_formatted are not recomputed when request data changes. Inbox and case lists keep stale titles until a later Eloquent save.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
| 'data', | ||
| 'token_properties', | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Raw save leaves scheduled tasks
High Severity
Closing or completing a token via raw SQL never runs ProcessRequestTokenObserver::saved, so timer scheduledTasks for that token are not deleted and can still fire after the activity is done.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
|
|
||
| $this->runUpdate('process_request_tokens', $tokenId, $payload); | ||
| $token->syncChanges(); | ||
| } |
There was a problem hiding this comment.
Raw persist skips search indexing
Medium Severity
Raw SQL updates do not fire Scout saved hooks. When indexed search is enabled, ProcessRequest and ProcessRequestToken documents are not updated after completion, so search results go stale.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5e7ca61. Configure here.
|
QA server K8S was successfully deployed https://ci-eaf6871c59.engk8s.processmaker.net |
FOUR-32800: test compares legacy and optimized
|
|
QA server K8S was successfully deployed https://ci-eaf6871c59.engk8s.processmaker.net |







Improve the api PUT /api/1.0/tasks/{task-id}
Related Tickets & Packages
Code Review Checklist
ci:deploy