[ 
https://issues.apache.org/jira/browse/WW-1742?focusedWorklogId=1037299&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1037299
 ]

ASF GitHub Bot logged work on WW-1742:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Aug/26 18:19
            Start Date: 23/Aug/26 18:19
    Worklog Time Spent: 10m 
      Work Description: 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)




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1037299)
    Remaining Estimate: 0h
            Time Spent: 10m

> new token associated execute and wait interceptor
> -------------------------------------------------
>
>                 Key: WW-1742
>                 URL: https://issues.apache.org/jira/browse/WW-1742
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>            Reporter: Thomas Micheline
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 7.4.0
>
>         Attachments: TokenizedExecuteAndWaitInterceptor.java
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> A new interceptor could be created which associates background processes with 
> a token rather than a session.  This way, an application could allow separate 
> background processes to the same user operating in multiple windows/tabs.  
> I'll provide the class which makes use of the getName method suggest in 
> WW-1740 (and the change in WW-1741 is also needed if the token interceptor 
> preceeds this interceptor in the stack).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to