-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] App fails to load in airplane mode #4831
Comments
seems relevant to you @khmyznikov |
I've debugged a bit more and it seems that setting |
@DirtyHairy just to confirm, setting that fixed the issue? |
Yeah, indeed, loading with However, I don't do that on first load, but only if the first load fails --- otherwise, if the service worker has not yet installed and my PWA changes sufficiently (i.e. script names changing and old versions being removed from the server) between the app being terminated and being restarted the service worker will never install and the user will be stuck with a broken version in the cache. Unfortunately, I still get a delay when there is bad network coverage on the first attempt to load. |
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
5 similar comments
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
This issue has been marked as "needs attention 👋" since it has not been triaged for 7 days. Please triage the issue . |
What happened?
If I start the app (with the service worker happy and running) the page will not load. Inspecting the web view shows that
navigator.serviceWorker
is not defined in this state.How do we reproduce the behavior?
What do you expect to happen?
App loads
What environment were you using?
iOS 17.7
Additional context
To me it seem that
WKWebView
does not properly initialise the service worker / registration properly if the first page load fails. I was able to work around the issue by trying a second load withcachePolicy: .returnCacheDataElseLoad
if the first load fails. This bug may be similar to #4649You can check the code in my app for reference: https://github.com/cloudpilot-emu/cpe-shim-ios/blob/master/app/CloudpilotEmu/ViewController.swift
I can prepare a pull request against the iOS shim if you like 😏
The text was updated successfully, but these errors were encountered: