realtime data not working in iPhone
-
Hi all, still using 3.5.6 here, however I've got issues with the fact that unlike android or desktop. Using google chrome and safari on the iPhone (iOS 13) doesn't appear to maintain its websocket connection.
From this I can click into other dashboard views and after a while the data does not update. Only a refresh/logout-login fixes this and the latest data appears in the dashboard.If I leave google chrome open on the iphone and maintain the screen to be open then the data updates automatically - not in safari. It doesn't do this once the screen turns off. On Android the connection resumes and picks up the latest data.
I've got a feeling where I'm going to have to poll for data...Got any suggestions here? I've got annoyed customers who can't bring up the page to review the latest data like I can in Android without fiddling with their login.
Fox
-
I tested this on my iPhone 8 and swiping down to refresh does fix it but you do not need to re-login.
-
Let me get this straight:
- You have no issues in Chrome on Android or Chrome on desktop
- You have issues in Chrome on iOS and Safari on iOS but they are slightly different
- On iOS the websockets stop working and you say you have to log out and log back in to see live updating data
From here it gets a bit hazy..
@mattfox said in realtime data not working in iPhone:
If I leave google chrome open on the iphone and maintain the screen to be open then the data updates automatically
So there is or there isn't an issue here?
@mattfox said in realtime data not working in iPhone:
not in safari. It doesn't do this once the screen turns off.
What exactly happens in Safari?
@mattfox said in realtime data not working in iPhone:
On Android the connection resumes and picks up the latest data.
I've got a feeling where I'm going to have to poll for data...When does Android on Safari stop getting live values? Not following this exactly.
-
I've got data that updates every five minutes. On the iPhone the page just stops. receiving realtime data. My customer says for him he has to login/out. I'm not certain if it is due to expired sessions. But I can honestly say that realtime data stops. This also means that when wanting to view status information, the data doesn't update. I can turn the screen off and on and the socket connection on the iPhone stops. If i always ensure the page stays active in chrome, then realtime continues. Once the screen shuts off, no more socket. I can click and view other dashboard pages, but the data doesn't come through, so just blank templates where data should be displayed.
I don't have these issues on Android.
Hope this makes sense.Fox
-
@mattfox said in realtime data not working in iPhone:
On the iPhone the page just stops. receiving realtime data.
Under what conditions? After how long?
@mattfox said in realtime data not working in iPhone:
My customer says for him he has to login/out. I'm not certain if it is due to expired sessions. But I can honestly say that realtime data stops.
If you have an iPhone can you please verify yourself. Sessions by default expire after 48 hours I believe so I doubt its that.
@mattfox said in realtime data not working in iPhone:
I can turn the screen off and on and the socket connection on the iPhone stops
This is to be expected.
@mattfox said in realtime data not working in iPhone:
Once the screen shuts off, no more socket.
Again this is expected. What should happen though is that the socket will reconnect and you will start getting live value updates again.
I am still not clear if you are seeing different behavior in Chrone on iOS verses Safari on iOS. I doubt there will be differences as they both use the Safari browser engine.
-
Again this is expected. What should happen though is that the socket will reconnect and you will start getting live value updates again.
Except this doesn't happen on the iPhone.
I don't know how long, all I have to do is log in to the dashboard and wait and after a while it stops. I don't currently have the tools required to debug and give you a definite answer. It'd be easier if it were Android because I could use the adb linked to google.chrome dev console. I can only give what I've found at the moment. I've got a bad feeling it is an apple thing and that there is no fix.
-
OK, I will try and get hold of a coworkers iPhone and reproduce.
edit. Just noticed you are using 3.5. Definitely upgrade to 3.6 and try that. However I will still test this out on iPhone on 3.6 and see if I find something.
-
Many thanks Jared, Craig confirmed he could replicate it but he didn't state whether or not it was the latest version or not.
-
@mattfox said in realtime data not working in iPhone:
hen wanting to view status information, the
I tested this on 3.6. If I lock the screen, then unlock after some time, there are no updates. To get an update I swipe down which refreshes the page. It does not require me to log back in.
-
Thanks Craig, I think my customer logs out and in out of frustration. He's saved the mango page to his home screen so it behaves like an app. He is likely unaware that dragging from the top causes a refresh.
-
Hi Jared, just giving this a bump and wondering if you were able to replicate this issue
Fox
-
@mattfox said in realtime data not working in iPhone:
Hi Jared, just giving this a bump and wondering if you were able to replicate this issue
Fox
@CraigWeb has confirmed it for me. Its on my list to investigate.
-
I somehow think there may not be a 'heartbeat' to ensure the pointvalues websocket stays alive, what can I generate from the server without storing the value to make all clients who log in subscribe to this through mango and update it every 20-30 seconds to ensure the connection doesn't drop?
If I have enough systems updating at minute intervals, they all cause the timeout to be pushed back. Problem is a lot of my other sensors update at 5-15 minute intervals.
Any further suggestions are welcome. -
@mattfox said in realtime data not working in iPhone:
I somehow think there may not be a 'heartbeat' to ensure the pointvalues websocket stays alive
There is. It uses the WebSocket ping/pong mechanism. We send a ping packet every 10s by default, it is configurable via the
web.websocket.pingTimeoutMs
env property. If we do not receive a pong response the server closes the WebSocket. The client should re-open the WebSocket immediately if the tab is active. -
@MattFox I found a problem in the logic around the client (UI) reconnecting after a WebSocket closes. I think this is probably what you were seeing. I'll get a new UI module out soon, I also made some backend changes but I think the UI module fix will address your symptoms.
-
Excellent, nicely identified Jared!
@jared-wiltshire are these changes I can implement myself to save me having to do any major upgrades? -
@mattfox said in realtime data not working in iPhone:
are these changes I can implement myself to save me having to do any major upgrades?
No they are not. I will be releasing a UI module for 3.7.x
-
Darn it ok, I'll see about doing system upgrades early next year when the pressure is reduced.
-
-
@Jared-Wiltshire Has this been resolved? I am running v4.0.0 beta.14 and noticed that the real-time data in Watchlist and dashboard is not showing up on iPhone's Safari or Chrome.