You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 fix(workflow): stop the workspace destroying itself on beforeunload #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 Summary
beforeunloadfires 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 abeforeunloadbinding 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:
HubWorkflowDetailComponentcallsworkflowActionService.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 fix(workflow): stop the workspace destroying itself on beforeunload #8600 applies: drop thebeforeunloadbinding and leave the clear inngOnDestroy.AgentPanelComponentcallsdeactivateCurrentAgent()from itsbeforeunloadbinding. 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
beforeunloadbindings only write panel geometry tolocalStorageand are unaffected.Task Type