Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Visitable sometimes stuck on infinite loading indicator #147

Open
mentoxska opened this issue Oct 30, 2018 · 4 comments
Open

Visitable sometimes stuck on infinite loading indicator #147

mentoxska opened this issue Oct 30, 2018 · 4 comments

Comments

@mentoxska
Copy link

mentoxska commented Oct 30, 2018

Hello,
we are building an app based on Turbolinks and Turbolinks-ios frameworks. The problem here we are facing is that when I sometime (happens like 1/10 visits) click on one of the tasks (image 1), I will get stuck on infinite loading indicator screen.
Tasks screen
Tasks

Stuck at infinite loading indicator
wheel

If I'm waiting like 10 minutes I 'll get this, retry button reloads the visitable and I can continue.
err

We are not receiving any crash report on device or front end so it's particularly difficult to debug.
This doesn't happen on the simulator though, only on physical device.

As a current fix to this issue I tried to add timer that checks every 5 seconds if loading indicator is active and if so, I am restarting the app. The goal here is to at least reload the visitable (what retry button on error view does) but I wasn't able to do so as functions visitable.retry() or session.reload() doesn't seem to do anything. How do I do this ?

@zachwaugh
Copy link
Contributor

Have you implemented all the WKWebView delegate methods and logged all possible errors from there? We had some intermittent failures in the past that were solved by implementing this method func webViewWebContentProcessDidTerminate()- https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi, which tells the app if the underlying process was terminated for some reason. If so, we automatically reload. I'm not sure why the manual button doesn't work though, calling session.reload() should do the trick.

@mentoxska
Copy link
Author

mentoxska commented Oct 30, 2018

It seems that if I want to go from this screen with infinite loading indicator to anywhere else (dashboard with tasks or profile buttons at top panel), I 'll get white blank screen.
When I wait until I get the errorView (image 3), I am able to reload (as retry button doesn't do anything else then session.reload() I guess?), so there must be some ongoing process which I couldn't interrupt by calling session.reload(). Are there any other methods I could call here to stop loading the visitable and get to the finished state where I am not frozen?
Thank you

@zachwaugh
Copy link
Contributor

Calling session.reload() should cancel any existing visits. I haven't seen this exact issue, so I can't really say what's happening without some more debugging info. I'd add a bunch of local logging as well as checking out server logs and see if you can narrow down where this is failing (i.e. - if it's not hitting your server at all, or just not processing the server response, etc).

@digerata
Copy link

We are hitting this exact problem. A HTTP -1 response. It is seemingly random, almost impossible to reproduce but you are guaranteed to hit it in our app 1 out of every 15 - 30 sessions.

I've been lucky where I've been able to watch the server logs while it happened once. I was very surprised to find that there was no request made to the server! So it seems like this supports the case to hook in to webViewWebContentProcessDidTerminate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants