auto-reconnect seems broken on 2018r1?

There was a lovely feature recently where if the client got disconnected then it would attempt to reconnect until the server was ready again. This meant that keeping a page up was easy and worked very well. If you woke up a machine with a page open instead of just displaying the this app has gone offline message it would display that and them momentarily reconnect.

With my same projects compiled with 2018r1 this doesn’t seem to work anymore, indeed I no longer get the error message about it going offline either. It just sits there with yesterday evenings display and never updates. There is no obvious indication that it’s offline either which is a problem. No new data is displayed obviously as it has no connection or session in the server. If you click a control nothing happens, no error feedback, no timeout to the error page, nothing. It just sits there dead showing old info.

Has anyone else noticed this? I haven’t opened a bug report yet as I haven’t verified for certain that this is a new problem. I will try to recompile with the previous version later on today to verify that it works with that but the next few days are going to be very hectic around here and I may not be able to really get it worked up to a bug report until next week.

Just checked with an empty project and it seems to be working properly.

Please check and see if you’re adjusting App.SessionTimeout anywhere as I’ve seen this cause problems like this if it’s set too low.

Hello Greg,

I have not adjusted App.SessionTimeout. Searching through the code reveals no references to sessionTimeout.

I’ve been watching it to see whats different and I think I see. If I quit the server app and restart it the reconnection works fine. What doesn’t work is if I let the computer lock it’s screen or go to sleep. When I wake the computer, or just wake the screen if it hasn’t gone to sleep, after some hours it’s still sitting there displaying the data from when it was shut down and makes no attempt at that time to reconnect. It definitely used to do that. I would wake up the computer in the morning and my test pages would all flash to the This App Has Gone Offline screen and then almost immediately successfully reload. Now they just wake up showing old data. No error page and no reload. They are just dead, disconnected from the server but not showing the error.

I’ve got exactly same situation with a my app that works fine from 5 years, rebuilded many times with various xojo version. From Xojo2018r1, some of my customers have reported occasional interface lock with no error but no response; reloading the app, everything works fine. During one of these lock, using chrome developer tools, I’ve inspected the browser-server interaction; I found some errors about lost connection.
This webapp stay open during all morning and all afternoon in many browser, so inside the app, the Session.Timeout is set to 14400 (4 hours).
I know it’s very difficult to found a possibile bug without a specific error or a sample project to reproduce the error, but when I read this post, I thought could be useful to report my similar experience.

@Pietro Beccegato - I’m more interested in App.SessionTimeout which is different than Session.Timeout.

I’ve built myself a little app that does nothing but display a clock updated every second. As I walk away and come back to the computer today I’ll try to catch it failing to reconnect. If it will show the same problem then I’ll open a feedback report and upload it. If not then I’ll keep thinking about it and see if I can find anything else :wink:

I meant Session.Timeout set into the session.open event.
I’ll try using also App.SessionTimeout set as Session.Timeout and I’ll check if this will resolve the situation.
Thanks for your suggestion.

[quote=389488:@Pietro Beccegato]I meant Session.Timeout set into the session.open event.
I’ll try using also App.SessionTimeout set as Session.Timeout and I’ll check if this will resolve the situation.
Thanks for your suggestion.[/quote]
That’s not what I meant. App.SessionTimeout is the number of seconds after a user leaves that the session gets destroyed. It should never be set to a number like 4 hours. It defaults to 180 seconds (3 minutes) which is plenty.

How about the App.SessionTimeout default value.
You said the App.SessionTimeout default value is 180 seconds (3 minutes), but documentation say the default value is 10.
Debugging a new clear empty webapp, the App.SessionTimeout is 10.
You say “180 seconds (3 minutes) is plenty”, but debugging my webapp, without set App.SessionTimeout, the App.SessionTimeout is 30.
Documentation says “setting it too low could disconnect active users”, so app.SessionTimeout=30 could cause the “interface lock” reported from my customers?

It’s set to 10 during debugging for convenience.

Unlikely. Low numbers would more likely cause users to just get disconnected while they were using the app.

Any news about your test? Have you understand where is the problem?

I finally got the test app to disconnect after the laptop was asleep with it’s lid closed under my bed all night last night. This morning it still says the time shortly after I closed the lid last night. I haven’t had a moment to make a bug report, and honestly I’m not sure if it should be a bug report or a feature request or what? I don’t see any documentation that says what the state of javascript is in a browser window that has been on a sleeping or otherwise locked computer for the last 8 hours? It definitely does not recover from that situation though, some other kind of error or something else to do to trap it. Obviously the regular timers or connection or whatever they do have long ago given up and nothing even happens to generate an error after that point.

It definitely used to work though. I don’t know if it was a software update on my machine that broke it or if it was that I compiled with a more recent xojo version. I’ll experiment with that next.

I can second this! Worked well before 2018r1.

I think it is a bug, because from an end user’s point of view it’s a regression.

Let us know if you make a bug report. I will probably implement a JS library to handle this anyway though.
http://github.hubspot.com/offline/docs/welcome/

[quote=389993:@James Sentman]I finally got the test app to disconnect after the laptop was asleep with it’s lid closed under my bed all night last night. This morning it still says the time shortly after I closed the lid last night. I haven’t had a moment to make a bug report, and honestly I’m not sure if it should be a bug report or a feature request or what? I don’t see any documentation that says what the state of javascript is in a browser window that has been on a sleeping or otherwise locked computer for the last 8 hours? It definitely does not recover from that situation though, some other kind of error or something else to do to trap it. Obviously the regular timers or connection or whatever they do have long ago given up and nothing even happens to generate an error after that point.

It definitely used to work though. I don’t know if it was a software update on my machine that broke it or if it was that I compiled with a more recent xojo version. I’ll experiment with that next.[/quote]
To clarify, what’s going on browser-side is that the JavaScript engine is pausing when your computer sleeps. Depending on your OS, JavaScript & communications can also be throttled when not in the foreground.

When a user returns and brings the browser window to the foreground, the Xojo framework checks to see how much time has passed by checking the system clock and tries to reconnect if it’s too long.

What it sounds like is that this mechanism either isn’t working or that JavaScript is still throttled or perhaps disabled.

Please file a bug report with your sample, a list of browsers & OS’s where you see this problem and if you know, the minimum amount of time required to show the problem. This one is going to be really tricky to track down if it really takes overnight to see it happen.

Hi Greg,

I Will submit a bug report as my case seems to be much easier to replicate. I have created the example builds but am having some trouble with the feedback app. (I think is due to poor network connectivity).

If I kill the server-app while the browser is connected (Or simply click stop in debug mode) the browser no longer shows the offline message or reconnects when the server-app is available again.

I will try to submit the bug report again tomorrow.

Here is the feedback case. <https://xojo.com/issue/52395>