yangzhang75 opened a new issue, #8601:
URL: https://github.com/apache/texera/issues/8601

   ### Task Summary
   
   `beforeunload` fires when a browser navigates away from a document, but the 
browser does not always discard that document: Chrome may keep it in the 
back/forward cache, and going back restores the JavaScript state exactly as it 
was left, re-running nothing. Anything a page destroys from a `beforeunload` 
binding therefore stays destroyed on a page that looks live.
   
   #8599 is one instance of this, fixed for the operator canvas and the Form 
View in #8600. Grepping for the same shape found two more, neither of them on 
the path #8599 reports, so they were left out of that PR:
   
   * `HubWorkflowDetailComponent` calls `workflowActionService.clearWorkflow()` 
from a `@HostListener("window:beforeunload")` binding, and has nothing else to 
do there. Restored from the cache, the page should show an empty workflow. Not 
reproduced, inferred from the identical code shape. The fix is the same one 
#8600 applies: drop the `beforeunload` binding and leave the clear in 
`ngOnDestroy`.
   * `AgentPanelComponent` calls `deactivateCurrentAgent()` from its 
`beforeunload` binding. Whether deactivating on unload is releasing something 
server-side that ought to be released is a judgement about that subsystem, so 
this one needs an opinion from someone who knows it before it is changed.
   
   The app's other four `beforeunload` bindings only write panel geometry to 
`localStorage` and are unaffected.
   
   ### Task Type
   
   - [x] Refactor / Cleanup
   


-- 
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]

Reply via email to