Example crash
Hi, thx for the nice lib.
I am using version 0.4.0 + nim 1.4.8 and noticed that example app (also my app) can crash when the page is reloaded frequently.
Either this can be checked in the browser by spamming the F5 button.
@sumatoshi Excuse the long delay on my end.
What happens when you refresh the page or visit another URL in your app, the web socket connection is closed and a procedure is called that checks, after 1.2 seconds, if another web socket connection exists. If it does not- the application closes. The reason this procedure even exists is because we need a way for the server to know if the browser window/tab is closed.
In all honesty it's a short term solution, or Band-Aid, for a long term problem. @NecroticOoze and I are considering having Neel act as a Single Page Application, and exploring other options.
Will keep this thread open and update you here with changes to this functionality
@sumatoshi
To prevent crashes when users spam refresh or constantly switch between different pages, we implemented a looping countdown timer before shutting down. Approximately 10 seconds after closing the app window, the server and program is killed if a WebSocket hasn't already reconnected within that time period. This does cause a delay from the time you close out of the app, just keep that in mind before doing CTL+C in the terminal during testing. It can be a little annoying for us having to wait 10 seconds before we can recompile but saves the pain of any user accidently crashing the app! This was the best solution with current implementation of Neel.