Skip to content

FOUR-34579 | Resolve Ticket Cache Drop and Parked Query Overwrites in ABE Enhancements - #9200

Open
mcraeteisha wants to merge 2 commits into
developfrom
observation/FOUR-34579
Open

mcraeteisha wants to merge 2 commits into
developfrom
observation/FOUR-34579

Conversation

@mcraeteisha

@mcraeteisha mcraeteisha commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Ticket: FOUR-34579

With Actions by Email Require Login, a leftover abe_click_ticket could delete a parked click when another update_variable URL was hit without abe_sig, so after login the short intended URL failed restore and returned validation errors instead of completing with the signed recipient. Separately, a second Approve/Reject click could be overwritten by an earlier parked query before re-parking, so after login the original action completed instead of the latest one.

Root cause: pullPendingAbeClickQuery used Cache::pull before confirming abe_uuid ownership, and restoreAbeClickQuery reapplied parked values whenever abe_sig was missing—including fresh clicks that already carried varName/varValue.

Solution

processmaker

  • TaskController::pullPendingAbeClickQuery: peek with Cache::get, consume with Cache::forget only when abe_uuid matches.
  • TaskController::restoreAbeClickQuery: skip restore when the request already has varName and varValue so a later click parks its own action.
  • TaskController::handleAbeVariableUpdate / resolveAbeVariableUpdateResponse: split for Sonar return-count compliance.
  • TokenRepository::abeProcessModelFromTokenInstance: collapse null-safe chain for Sonar return-count compliance.
  • tests/Feature/TaskControllerTest.php: add testAbeClickTicketCacheSurvivesUuidMismatch and testLaterAbeClickWithRequireLoginParksLatestAction.

How To Test

Automated Tests

  • vendor/bin/phpunit --filter 'testRequireLoginPreservesSignedRecipientAndSetsIdentityMismatch|testMissingAbeClickQueryAfterFailedRestoreReturnsValidationError|testAbeClickTicketCacheSurvivesUuidMismatch|testLaterAbeClickWithRequireLoginParksLatestAction|testActionByEmailWithScreen' tests/Feature/TaskControllerTest.php

Manual Tests

  1. Enable ABE with Require Login (tracking on or off). As anonymous, click an action link, then open a different ABE update_variable URL (or a short URL for another token) that still carries the leftover abe_click_ticket. Log in and return via the original intended URL.
    - Expected: original parked click still completes; ticket cache for the matching ABE token is not dropped by the mismatched hit. Then click Approve, then Reject before login; after login the later action (Reject) completes.

ci:deploy

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way

Prevent mismatched ABE tokens from consuming parked click data, and ensure fresh action parameters take precedence after login. Add regression tests for ticket reuse and successive clicks.
@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches Require Login ABE completion paths and request validation; behavior changes are targeted but affect how email actions complete after login.

Overview
Fixes Actions by Email (Require Login) cases where a stale abe_click_ticket could drop or mis-apply a parked approve/reject click.

pullPendingAbeClickQuery now peeks with Cache::get and only Cache::forgets when the cached abe_uuid matches the current token, so visiting another ABE update_variable URL no longer consumes another token’s park.

restoreAbeClickQuery no longer merges a parked query when the request already has varName or varValue, so a later Approve/Reject is parked as-is and partial or invalid params return 422 via validation instead of reviving the old action or 500.

handleAbeVariableUpdate is split into resolveAbeVariableUpdateResponse (Sonar return-count). TokenRepository::abeProcessModelFromTokenInstance is a small null-safe chain refactor. Feature tests cover UUID mismatch, latest-click parking, and partial/invalid action params.

Reviewed by Cursor Bugbot for commit f618f82. Bugbot is set up for automated code reviews on this repo. Configure here.

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-6e41dba15a.engk8s.processmaker.net

Base automatically changed from story/FOUR-34301 to develop November 26, 2026 02:14
@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-6e41dba15a.engk8s.processmaker.net

@eiresendez eiresendez left a comment

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.

Hi @mcraeteisha, I left a comment on the PR with a potential validation edge case I spotted during static review. Could you take a look and let me know if the finding makes sense to you?

Skip restoring a parked click whenever either action parameter is present, leaving partial and invalid values to validation. Add regression coverage for partial and array-valued queries.

@eiresendez eiresendez left a comment

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.

No merge blockers found 👍

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-6e41dba15a.engk8s.processmaker.net

@decisions-sonarqube

Copy link
Copy Markdown

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