netcreateorg / netcreate-2018

Please report bugs, problems, ideas in the project Issues page: https://github.com/netcreateorg/netcreate-2018/issues
Other
11 stars 2 forks source link

Review beforeunload implementation #86

Open benloh opened 4 years ago

benloh commented 4 years ago

We need to warn users before they browse away.

The approach needs to be adjusted to either use React hooks/lifecycle, a custom React package, and/or clean up listeners.

Also, each EdgeEditor should not be adding it's own window.onbeforeunload listener. It ought to be handled at the app level?

benloh commented 4 years ago

Joshua notes the problem:

I’m not sure how unlock works but the problem is with users occasionally navigating away, reloading, etc. so this was intended to address the user side so that if they are navigating away without completing an edit we offer them the choice and then cancel their edit if they don’t take it. Some related issues such as a crash mid-edit aren’t addressed but we think this covers most. Long-term we think the meme model of being aware on the client is also potentially useful, as well as a chron job that just cancels any locks that have sat too long but that’s less frequent an issue I think... but yes we should create issues. …