After sucessfully install the new bundle version (1.1.14), the browser console (WebKitView) throws the following error:
Capacitor Updater fallback to the built in version sucessfully, because the CapacitorUpdater.notifyAppReady() is never called after 10s on the new version.
Expected Behavior
The new bundled zip version should run the js scripts well.
Code Reproduction
App built-in version: 1.1.12.
import { CapacitorUpdater } from '@capgo/capacitor-updater'
import { SplashScreen } from '@capacitor/splash-screen'
import { App } from '@capacitor/app'
let data = {version: ""}
CapacitorUpdater.notifyAppReady()
App.addListener('appStateChange', async(state) => {
if (state.isActive) {
data = await CapacitorUpdater.download({
version: '1.1.14',
url: 'https://maranatha.imedicineapp.com/api/app/native/bundles/1.1.14',
})
}
if (!state.isActive && data.version !== "") {
SplashScreen.show()
try {
await CapacitorUpdater.set(data)
} catch (err) {
console.log(err)
SplashScreen.hide() // in case the set fail, otherwise the new app will have to hide it
}
}
})
Other Technical Details
-> XCode Logs:
β‘οΈ [log] - {"bundles":[{"version":"1.1.14","size":"6670822","url":"https://maranatha.imedicineapp.com/api/app/native/bundles/1.1.14"}]}
β‘οΈ To Native -> CapacitorUpdater download 132923118
β¨ Capacitor-updater: Downloading Optional(https://maranatha.imedicineapp.com/api/app/native/bundles/1.1.14)
β¨ Capacitor-updater: Storing info for bundle [ITvWJ8EeG3] { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:49.133Z", "checksum": "", "status": "downloading"}
β¨ Capacitor-updater: Stats sent for download_0, version 1.1.14
β¨ Capacitor-updater: Stats sent for download_10, version 1.1.14
β¨ Capacitor-updater: Cannot found privateKey or sessionKey
β¨ Capacitor-updater: Stats sent for download_80, version 1.1.14
β¨ Capacitor-updater: Storing info for bundle [ITvWJ8EeG3] { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β‘οΈ TO JS {"checksum":"b661cb90","downloaded":"2024-04-07T23:18:54.948Z","status":"pending","id":"ITvWJ8EeG3","version":"1.1.14"}
β¨ Capacitor-updater: Stats sent for download_complete, version 1.1.14
β‘οΈ TO JS {"isActive":false}
β‘οΈ TO JS {"isActive":true}
β‘οΈ To Native -> SplashScreen show 132923119
β‘οΈ To Native -> CapacitorUpdater set 132923120
β¨ Capacitor-updater: Current bundle set to: /var/mobile/Containers/Data/Application/22D02258-3BD9-4E75-AEBE-5EC2E74AB10A/Library/NoCloud/ionic_built_snapshots/ITvWJ8EeG3
β¨ Capacitor-updater: Setting status for bundle [ITvWJ8EeG3] to PENDING
β¨ Capacitor-updater: Storing info for bundle [ITvWJ8EeG3] { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β¨ Capacitor-updater: Set active bundle: ITvWJ8EeG3
β¨ Capacitor-updater: semaphoreUp
β¨ Capacitor-updater: semaphoreWait 0
β¨ Capacitor-updater: Reloading ITvWJ8EeG3
β¨ Capacitor-updater: Wait for 10000 ms, then check for notifyAppReady
β‘οΈ TO JS undefined
β‘οΈ To Native -> SentryCapacitor addBreadcrumb 132923121
β‘οΈ TO JS undefined
β‘οΈ To Native -> SentryCapacitor addBreadcrumb 132923122
β‘οΈ TO JS undefined
β‘οΈ [error] - {"message":"Network Error","name":"AxiosError","stack":"@capacitor://localhost/assets/index-c0e53703.js:12:64347\na@capacitor://localhost/assets/index-c0e53703.js:7:96846","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":"xhr","transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Authorization":"Bearer 209|ifOzjlLufxqTN1q1IZW3yvefYH66BJh1KDTYKWB18bbfe800","ngrok-skip-browser-warning":"true"},"params":{},"method":"get","url":"https://maranatha.imedicineapp.com/api/app/native/bundles"},"code":"ERR_NETWORK","status":null}
β‘οΈ To Native -> SentryCapacitor fetchNativeSdkInfo 132923123
β‘οΈ TO JS {"version":"8.18.0","name":"sentry.cocoa.capacitor"}
β‘οΈ To Native -> SentryCapacitor fetchNativeSdkInfo 132923124
β‘οΈ TO JS {"version":"8.18.0","name":"sentry.cocoa.capacitor"}
β‘οΈ To Native -> SentryCapacitor fetchNativeDeviceContexts 132923125
β‘οΈ To Native -> SentryCapacitor fetchNativeDeviceContexts 132923126
β‘οΈ TO JS {"context":{"os":{"version":"17.4.1","build":"21E236","rooted":false,"kernel_version":"Darwin Kernel Version 23.4.0: Fri Mar 8 23:31:19 PST 2024; root:xnu-10063.102.14~67\/RELEASE_ARM64_T8110","name":"iOS"},"app":{"app_build":"32","app_identifier":"com.im
β‘οΈ TO JS {"context":{"os":{"version":"17.4.1","build":"21E236","rooted":false,"kernel_version":"Darwin Kernel Version 23.4.0: Fri Mar 8 23:31:19 PST 2024; root:xnu-10063.102.14~67\/RELEASE_ARM64_T8110","name":"iOS"},"app":{"device_app_hash":"3edd48fa83345725145a4e
β‘οΈ [log] - onscript loading complete
β‘οΈ WebView loaded
β¨ Capacitor-updater: Stats sent for set, version 1.1.14
β‘οΈ TO JS undefined
β¨ Capacitor-updater: Current bundle is: { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β¨ Capacitor-updater: notifyAppReady was not called, roll back current bundle: { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β¨ Capacitor-updater: Did you forget to call 'notifyAppReady()' in your Capacitor App code?
β¨ Capacitor-updater: Setting status for bundle [ITvWJ8EeG3] to ERROR
β¨ Capacitor-updater: Storing info for bundle [ITvWJ8EeG3] { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "error"}
β¨ Capacitor-updater: Resetting to builtin version
β¨ Capacitor-updater: reset: false
β¨ Capacitor-updater: Current bundle set to: builtin
β¨ Capacitor-updater: semaphoreUp
β¨ Capacitor-updater: semaphoreWait 0
β¨ Capacitor-updater: Reloading builtin
β¨ Capacitor-updater: Wait for 10000 ms, then check for notifyAppReady
β¨ Capacitor-updater: Deleting failing bundle: { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β¨ Capacitor-updater: Storing info for bundle [ITvWJ8EeG3] { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "deleted"}
β¨ Capacitor-updater: bundle delete 1.1.14
β¨ Capacitor-updater: Failed to delete failed bundle: { "id": "ITvWJ8EeG3", "version": "1.1.14", "downloaded": "2024-04-07T23:18:54.948Z", "checksum": "b661cb90", "status": "pending"}
β‘οΈ [log] - onscript loading complete
β‘οΈ WebView loaded
β‘οΈ To Native -> SentryCapacitor initNativeSdk 66024580
β‘οΈ TO JS undefined
β‘οΈ To Native -> SentryCapacitor addBreadcrumb 66024581
β‘οΈ TO JS undefined
β‘οΈ To Native -> SentryCapacitor addBreadcrumb 66024582
β‘οΈ TO JS undefined
β‘οΈ [log] - {"appVersion":"1.1.12"}
β‘οΈ To Native -> CapacitorUpdater notifyAppReady 66024587
β¨ Capacitor-updater: semaphoreDown
β¨ Capacitor-updater: Setting status for bundle [builtin] to SUCCESS
β¨ Capacitor-updater: Not saving info for bundle [builtin] { "id": "builtin", "version": "builtin", "downloaded": "1970-01-01T00:00:00.000Z", "checksum": "", "status": "success"}
β¨ Capacitor-updater: Fallback bundle is: { "id": "builtin", "version": "builtin", "downloaded": "1970-01-01T00:00:00.000Z", "checksum": "", "status": "success"}
β¨ Capacitor-updater: Version successfully loaded: { "id": "builtin", "version": "builtin", "downloaded": "1970-01-01T00:00:00.000Z", "checksum": "", "status": "success"}
β¨ Capacitor-updater: Current bundle loaded successfully. ['notifyAppReady()' was called] { "id": "builtin", "version": "builtin", "downloaded": "1970-01-01T00:00:00.000Z", "checksum": "", "status": "success"}
β‘οΈ TO JS {"bundle":{"version":"builtin","id":"builtin","downloaded":"1970-01-01T00:00:00.000Z","checksum":"","status":"success"}}
β¨ Capacitor-updater: Stats sent for update_fail, version 1.1.14
β¨ Capacitor-updater: Stats sent for reset, version builtin
β¨ Capacitor-updater: Stats sent for delete, version 1.1.14
Bug Report
Capacitor Version
Plugin Version
context(s)
Platform(s)
Current Behavior
After sucessfully install the new bundle version (1.1.14), the browser console (WebKitView) throws the following error:
Capacitor Updater fallback to the built in version sucessfully, because the
CapacitorUpdater.notifyAppReady()
is never called after 10s on the new version.Expected Behavior
The new bundled zip version should run the js scripts well.
Code Reproduction
App built-in version: 1.1.12.
Other Technical Details
-> XCode Logs:
npm --version
output: v9.5.1node --version
output: v18.16.0pod --version
output (iOS issues only): 1.15.2