Skip to content

Support loop element resolution during compensation#8127

Open
somiljain2006 wants to merge 4 commits into
apache:2.xfrom
somiljain2006:Loop-compensation-issue
Open

Support loop element resolution during compensation#8127
somiljain2006 wants to merge 4 commits into
apache:2.xfrom
somiljain2006:Loop-compensation-issue

Conversation

@somiljain2006

@somiljain2006 somiljain2006 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR did

Re-evaluate the loop collection expression during compensation and reconstruct the loop element using the restored loop index. This allows compensation tasks within loop states to access the corresponding loop element and index through the state machine context.

Ⅱ. Does this pull request fix one issue?

Fixes #6776

Ⅲ. Why don't you add test cases (unit test/integration test)?

Added unit tests covering compensation-time expression evaluation and loop element reconstruction.

Ⅳ. Describe how to verify it

  1. Run LoopTaskHandlerInterceptorTest.
  2. Run StateMachineDBTests.

Ⅴ. Special notes for reviews

N/A

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.70%. Comparing base (2f3de1c) to head (e893b2d).

Files with missing lines Patch % Lines
...pcext/interceptors/LoopTaskHandlerInterceptor.java 90.47% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #8127      +/-   ##
============================================
- Coverage     72.92%   72.70%   -0.23%     
+ Complexity      883      879       -4     
============================================
  Files          1327     1327              
  Lines         50769    50781      +12     
  Branches       6058     6062       +4     
============================================
- Hits          37025    36919     -106     
- Misses        10735    10870     +135     
+ Partials       3009     2992      -17     
Files with missing lines Coverage Δ
...pcext/interceptors/LoopTaskHandlerInterceptor.java 92.85% <90.47%> (+16.99%) ⬆️

... and 35 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@somiljain2006

Copy link
Copy Markdown
Contributor Author

@funky-eyes @slievrly Can you review this pr?

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.

SAGA Loop循环事务补偿入参问题咨询

1 participant