From 66712bdd248a63f9e9cabb1c0cc6e06f7d70e773 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Sat, 2 Dec 2023 19:44:19 +0100 Subject: [PATCH] fix: iOS app not starting --- frontend/app/package.json | 2 +- frontend/app/src/app/app.component.ts | 4 ++-- .../background/schedule/schedule-sync.service.ts | 6 +++++- pnpm-lock.yaml | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/app/package.json b/frontend/app/package.json index 0b3ea93e..4f411ba1 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -87,7 +87,7 @@ "@openstapps/api": "workspace:*", "@openstapps/collection-utils": "workspace:*", "@openstapps/core": "workspace:*", - "@transistorsoft/capacitor-background-fetch": "1.0.2", + "@transistorsoft/capacitor-background-fetch": "5.1.1", "@types/dom-view-transitions": "1.0.1", "capacitor-secure-storage-plugin": "0.9.0", "cordova-plugin-calendar": "5.1.6", diff --git a/frontend/app/src/app/app.component.ts b/frontend/app/src/app/app.component.ts index ed2daedc..ca2b6380 100644 --- a/frontend/app/src/app/app.component.ts +++ b/frontend/app/src/app/app.component.ts @@ -75,10 +75,10 @@ export class AppComponent implements AfterContentInit { }); if (document.readyState === 'complete') { - requestIdleCallback(this.hideSplash.bind(this)); + this.hideSplash(); } else { document.addEventListener('readystatechange', () => { - if (document.readyState === 'complete') requestIdleCallback(this.hideSplash.bind(this)); + if (document.readyState === 'complete') this.hideSplash(); }); } } diff --git a/frontend/app/src/app/modules/background/schedule/schedule-sync.service.ts b/frontend/app/src/app/modules/background/schedule/schedule-sync.service.ts index 1521105b..e912a7ed 100644 --- a/frontend/app/src/app/modules/background/schedule/schedule-sync.service.ts +++ b/frontend/app/src/app/modules/background/schedule/schedule-sync.service.ts @@ -89,7 +89,11 @@ export class ScheduleSyncService { async taskId => { await Promise.all([this.postDifferencesNotification(), this.syncNativeCalendar()]); - await BackgroundFetch.finish(taskId); + BackgroundFetch.finish(taskId); + }, + async taskId => { + console.log('[BackgroundFetch] TIMEOUT:', taskId); + BackgroundFetch.finish(taskId); }, ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f58fc83b..09f5e2de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -822,8 +822,8 @@ importers: specifier: workspace:* version: link:../../packages/core '@transistorsoft/capacitor-background-fetch': - specifier: 1.0.2 - version: 1.0.2(@capacitor/core@5.5.0) + specifier: 5.1.1 + version: 5.1.1(@capacitor/core@5.5.0) '@types/dom-view-transitions': specifier: 1.0.1 version: 1.0.1 @@ -6755,10 +6755,10 @@ packages: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} - /@transistorsoft/capacitor-background-fetch@1.0.2(@capacitor/core@5.5.0): - resolution: {integrity: sha512-eF92oeLYg7cZNGtlUMq6nZH1Q0i3wIXyQKlsWRBlaSey/DhL+Ncv1//ejbH+FQ427bC+CT1PPAD/OrPsJeL7+g==} + /@transistorsoft/capacitor-background-fetch@5.1.1(@capacitor/core@5.5.0): + resolution: {integrity: sha512-TwDVxFgnegCq5fPWG7Qy5Ws87enbBiZtnKI5Y96OpMn/BzUWyL4J6bRfx85OTNDO0MIk07u0YFHxYrzPETrWJA==} peerDependencies: - '@capacitor/core': ^4.0.0 + '@capacitor/core': ^5.0.0 dependencies: '@capacitor/core': 5.5.0 dev: false