Issue Description:
When using React, you have 2 methods to cleanup side effects from components:
- componentWillUnmount
- useEffect’s cleanup function
When a window in overwolf is closed, the window is closed directly without running this react flow
Can you reproduce it:
yes.
- Create a simple OW app using react (“Hello world” window)
- Add a
console.log
to one of the mounted components’scomponentWillUnmount
lifecycle - Observe the logs.
At this point, you’ll notice that the log is written (as the method did not run)
Impact for my app:
Medium-High
We have some functionalities that don’t run due to that and it may cause data corruption/ missing analytics
Do you currently have a workaround?
Not really.
The closest workaround we have involves registering to beforeunload
, which means potentially running these flows twice or more sometimes.