Palindrom / palindrom-client

Three-way data binding server - JS - HTML kept in flawless sync with JSON Patch, WebSockets/HTTP
MIT License
3 stars 1 forks source link

Palindrom disconnects, and then connects again (displaying the "reconnecting warning") #61

Closed Joltrix closed 6 years ago

Joltrix commented 6 years ago

Steps to reproduce

Just by running a solution of apps for a while will cause the reconnecting "warning" to appear. So the page will disconnect and then connect again. This time it takes for it to reconnect again is usually between 0.5 and 1 second.

Browsers affected

I'm not sure which browsers it's working/not working on, since this app solution is not working across all browsers, but it can be reproducible on Chrome

Joltrix commented 6 years ago

cc @alshakero

warpech commented 6 years ago

Can you reproduce it only with your app or also KitchenSink?

What is the Starcounter version?

alshakero commented 6 years ago

I've just seen it in AdFenix'es chat bot.

Joltrix commented 6 years ago

@warpech the build I'm using is the custom 2.4 build with the mapping. :/

alshakero commented 6 years ago

I tried to reproduce the issue myself on KitchenSink and it didn't happen in 10 mins on KitchenSink. However, I mananged to reproduce it in Flexovital app. Thus probably it's a server issue.

Waiting for it to happen is dreadful, what I did was viewed Sources (in Chrome DevTools) and searched for palindrom-dom.min.js, then found reestablish function within the code, put a break point there, and waited. Because focusing for minutes waiting a blink is tough.

atifwaqar commented 6 years ago

@alshakero About AdFenix's Chatbot app, we are using IIS to support https traffic. Do you think this can be an issue?

atifwaqar commented 6 years ago

Also, in our case when the connection is broken, its not fixed again, unless we I refresh/reopen the page. And here is how the exceptions look like

image

warpech commented 6 years ago

@atifwaqar I went to your test server (the URL you sent on Slack) and waited on the page for 30 minutes. The connection did not drop. Palindrom sent a WS ping message to the server every 60 seconds.

Maybe your issue is caused by your computer going to sleep? In that case, the session will time out after the number of minutes configured in DefaultSessionTimeoutMinutes? See https://docs.starcounter.io/v/2.4/guides/web-apps/sessions. In future, we might come up with a better solution. Follow https://github.com/Palindrom/Palindrom/issues/179.

@atifwaqar, @Joltrix Can you please steps to reproduce your issues?

Joltrix commented 6 years ago

@warpech

Well, all I need to do is to run the apps. and when everything is up and running and working fine, sometimes it will just disconnect for half a second and then reconnect without me having to manually reconnect.

As previously mentioned though, I am using the custom 2.4 mapping version of Starcounter, And we are running about 9 apps that are mapped and blended.

So there isn't really any "steps", it just happens when it runs :/

atifwaqar commented 6 years ago

Maybe your issue is caused by your computer going to sleep?

That is not the case. and I have experienced this on multiple machines, Even @mmnosek experienced this issue.

And sadly, I have no idea how to reproduce it. I just leave the tab open for monitoring chats on servers (live server and test). And whenever i visit the tabs after sometime the page disconnects.

feel free to keep my test server's page open in a tab for an hour, and observe the behavior.

warpech commented 6 years ago

I investigated the problem that was explained by @Joltrix. Chrome DevTools show me that WebSocket disconnects exactly after 1 minute. The server is behind a Nginx proxy. Googling about this problem showed me that this is probably caused by Nginx proxy_read_timeout setting set to 60 (1 minute). Source: https://github.com/tornadoweb/tornado/issues/1070

@Joltrix, @habib535 pls give it a try.


@atifwaqar your problem is not related to that. I will test again.

warpech commented 6 years ago

Re: @Joltrix problem is tracked in https://github.com/StarcounterApps/AppsTeam/issues/166. If the issue persists, we will track it there.


Re: @atifwaqar. I left my computer open with the link that you provided in on Slack for 75 minutes in Windows PC running Google Chrome 63.0 with Starcounter DevTools 3.3.0. I could not reproduce the problem. I have a screen recording for that.

I believe that this issue exists but there is no way to investigate it unless I get a reproduction as concrete steps or a screen recording.

@atifwaqar please open a new issue when you have that, thanks!