Repository navigation
WW-5765 Re-store only the token validated in the request in execAndWait - #2022
Open
lukaszlenart wants to merge 1 commit into
Open
lukaszlenart wants to merge 1 commit into
lukaszlenart wants to merge 1 commit into
Conversation
…quest in execAndWait ExecuteAndWaitInterceptor put a transaction token back into the session on every wait result, reading the value from the "token" request parameter and the name from "struts.token.name". It did so whether or not a token had been validated in the current request, including for execAndWait actions without a token check, and it read the value and the name under different names. TokenHelper.validToken() now records the token name and value it accepted in the current ActionContext, and the new TokenHelper.restoreValidatedToken() puts exactly that pair back into the session. ExecuteAndWaitInterceptor calls it instead of reading request parameters, so with no validated token it leaves the session token store unchanged. Actions combining token or tokenSession with execAndWait keep accepting wait-page refreshes as before (WW-1741). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lukaszlenart
marked this pull request as ready for review
October 15, 2026 16:59
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes WW-5765
Problem
ExecuteAndWaitInterceptorputs a transaction token back into the session every time it returns the wait result, so that an action combiningtokenandexecAndWaitkeeps accepting its wait-page refreshes afterTokenInterceptorhas consumed the token (WW-1741). It took the value from thetokenrequest parameter and the name fromstruts.token.name, and did so whether or not a token had been validated in the current request, including forexecAndWaitactions with no token check, such as one usingexecuteAndWaitStack. The value and the name were also read under different names.Approach
TokenHelper.validToken()records the token name and value it accepted in the currentActionContext.TokenHelper.restoreValidatedToken()puts exactly that pair back into the session, and does nothing when no token was validated in the current request.ExecuteAndWaitInterceptorcalls it instead of reading request parameters.Behaviour change
A token is now re-stored only if it went through
TokenHelper.validToken()earlier in the same request. Setups where that never happened, such as a token interceptor ordered afterexecAndWaitor custom token checking that bypassesTokenHelper, no longer get a token re-stored on the wait result. Worth a line in the migration notes.Tests
ExecuteAndWaitInterceptorTestexecAndWaitaction without a token interceptor returnswaitand leaves the session token store unchanged, for the default and a custom token name; this fails on the previous code;token+execAndWaitandtokenSession+execAndWaitkeep accepting the wait-page refresh that carries the validated token, then consume it on completion.TokenHelperTest: the validated token is restored; a rejected or unvalidated token leaves the session unchanged../mvnw -pl core test: 3472 tests, 0 failures, 0 errors.A matching PR targets
support/struts-6-x-x.🤖 Generated with Claude Code