lukaszlenart opened a new pull request, #1861: URL: https://github.com/apache/struts/pull/1861
Fixes [WW-1742](https://issues.apache.org/jira/browse/WW-1742) ## Background WW-1742 (filed 2007) asked Struts to ship a `TokenizedExecuteAndWaitInterceptor` so that several browser tabs of the same session could each run the same action in the background, instead of the second tab joining the process the first one started. The dependency it was waiting on has long since landed: WW-1740 added the `getBackgroundProcessName(ActionProxy)` hook, and WW-1741 made the interceptor re-set the session token before returning `wait`. The capability is therefore already reachable in a handful of lines — the attached patch is just no longer applicable, because it overrides `getName(ActionInvocation)`, a method that no longer exists. What is missing is documentation, not a framework hook. ## Why not ship the class Two properties make a token-keyed default a bad trade: - The session entry is removed only when a request observes the background process as done. With the action-name key the number of stranded entries is bounded by the number of `execAndWait` actions; with a per-token key every abandoned run strands a `BackgroundProcess` — and the action instance it holds — in the session, unbounded. - The stock key fails safe: a wait page that loses its parameters still joins the running process. A token key fails open — every refresh that drops the token starts another background process. ## What this PR does - Documents the override in the interceptor's `extending` javadoc snippet (the one rendered on the site), with the sample class and both caveats spelled out. - Adds `ExecuteAndWaitInterceptorTokenScopeTest`, covering both keyings: two tabs share one process under the action-name default, and get one process each under the documented override. The second test also guards the hook itself against being renamed again, which is what invalidated the original patch. No behaviour change. ## Testing ``` mvn test -DskipAssembly -pl core -Dtest=ExecuteAndWaitInterceptorTokenScopeTest,ExecuteAndWaitInterceptorTest ``` 2 + 8 tests, 0 failures. `mvn -pl core javadoc:javadoc` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
