We are working on a PWA app packaged as a native app using capacitor, that works very well beside one network issue :
App is opened while WIFI is ON, works well
Wifi is disabled, mobile is now on 4G
Network no longer works inside the app, but works fine on the mobile otherwise
After a while, network works again inside the app (something like 20s)
After that point, if you go back and forth between Wifi and cellular, the issue do not appear again, it only appear if the is the first time you do it inside the app, after you haven't touch your mobile phone for a while.
If you open or close the app, it wont happen again.
If you push a new build, it wont happen again.
But if you dont use your phone for a while (like a few hours it seems), then it will almost always happen the first time you use the app, then wont happen again until next session...
That make it very hard to debug.
A few more informations :
Standalone PWA
Same app installed as a Standalone PWA (Add to Home Screen) works fine even when the Native version has the broken network, once the Standalone has been used, then the Native starts to work again.
Catch errors
This is the only error I'm abled to catch when the issue appear :
2022-08-26 10:04:01.863024+0200 App[39920:2421520] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2022-08-26 10:04:01.863212+0200 App[39920:2421520] [ProcessSuspension] 0x10b0084a0 - ProcessAssertion: Failed to acquire RBS assertion 'GPUProcess Background Assertion' for process with PID=39926, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
Resulting in Axios failing to connect with that error :
⚡️ [log] - {"message":"timeout of 5000ms exceeded","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":5000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{"FormData":null},"headers":{"Accept":"application/json, text/plain, */*"},"baseURL":"https://api-DOMAIN/","method":"get","url":"v1/ENDPOINT"},"code":"ECONNABORTED","status":null}
Test conditions
Required iOS 13
Tested with iOS 15.6 on iPhone 13 Pro and iPhone 11 with same issue on both
Any help or opinion on what we could try to fix that is welcome, we are running out of ideas :)
Thanks a lot for reading !
G.