@capgo/capacitor-updater 5.2.12 → 5.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,7 @@ public class CapacitorUpdaterPlugin
58
58
  private static final String channelUrlDefault =
59
59
  "https://api.capgo.app/channel_self";
60
60
 
61
- private final String PLUGIN_VERSION = "5.2.12";
61
+ private final String PLUGIN_VERSION = "5.2.13";
62
62
  private static final String DELAY_CONDITION_PREFERENCES = "";
63
63
 
64
64
  private SharedPreferences.Editor editor;
@@ -184,13 +184,14 @@ public class CapacitorUpdaterPlugin
184
184
  ret.put("status", "update installed");
185
185
  CapacitorUpdaterPlugin.this.implementation.set(latest);
186
186
  CapacitorUpdaterPlugin.this._reload();
187
- CapacitorUpdaterPlugin.this.notifyListeners("appReady", ret);
188
187
  new Thread(() -> {
189
188
  try {
189
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady directUpdateFinish");
190
190
  CapacitorUpdaterPlugin.this.semaphoreReady.await(
191
191
  CapacitorUpdaterPlugin.this.appReadyTimeout,
192
192
  TimeUnit.SECONDS
193
193
  );
194
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady directUpdateFinish done");
194
195
  } catch (InterruptedException e) {
195
196
  e.printStackTrace();
196
197
  }
@@ -456,7 +457,16 @@ public class CapacitorUpdaterPlugin
456
457
 
457
458
  private boolean _reload() {
458
459
  final String path = this.implementation.getCurrentBundlePath();
459
- this.semaphoreReady.countDown();
460
+ new Thread(() -> {
461
+ try {
462
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady _reload");
463
+ CapacitorUpdaterPlugin.this.semaphoreReady.await(0, TimeUnit.SECONDS);
464
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady _reload done");
465
+ } catch (InterruptedException e) {
466
+ e.printStackTrace();
467
+ }
468
+ })
469
+ .start();
460
470
  Log.i(CapacitorUpdater.TAG, "Reloading: " + path);
461
471
  if (this.implementation.isUsingBuiltin()) {
462
472
  this.bridge.setServerAssetPath(path);
@@ -674,7 +684,9 @@ public class CapacitorUpdaterPlugin
674
684
  "Current bundle loaded successfully. ['notifyAppReady()' was called] " +
675
685
  bundle
676
686
  );
687
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady countDown");
677
688
  this.semaphoreReady.countDown();
689
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady countDown done");
678
690
  call.resolve();
679
691
  } catch (final Exception e) {
680
692
  Log.e(
@@ -885,7 +897,18 @@ public class CapacitorUpdaterPlugin
885
897
  ret.put("bundle", current.toJSON());
886
898
  this.notifyListeners("noNeedUpdate", ret);
887
899
  ret.put("message", msg);
888
- this.notifyListeners("appReady", ret);
900
+ new Thread(() -> {
901
+ try {
902
+ CapacitorUpdaterPlugin.this.semaphoreReady.await(
903
+ CapacitorUpdaterPlugin.this.appReadyTimeout,
904
+ TimeUnit.SECONDS
905
+ );
906
+ } catch (InterruptedException e) {
907
+ e.printStackTrace();
908
+ }
909
+ CapacitorUpdaterPlugin.this.notifyListeners("appReady", ret);
910
+ })
911
+ .start();
889
912
  Log.i(CapacitorUpdater.TAG, "endBackGroundTaskWithNotif " + msg);
890
913
  }
891
914
 
@@ -1257,10 +1280,12 @@ public class CapacitorUpdaterPlugin
1257
1280
  Log.i(CapacitorUpdater.TAG, "Auto update is disabled");
1258
1281
  new Thread(() -> {
1259
1282
  try {
1283
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady Auto update");
1260
1284
  CapacitorUpdaterPlugin.this.semaphoreReady.await(
1261
1285
  CapacitorUpdaterPlugin.this.appReadyTimeout,
1262
1286
  TimeUnit.SECONDS
1263
1287
  );
1288
+ // Log.i(CapacitorUpdater.TAG, "semaphoreReady Auto update done");
1264
1289
  } catch (InterruptedException e) {
1265
1290
  e.printStackTrace();
1266
1291
  }
@@ -15,7 +15,7 @@ import Version
15
15
  @objc(CapacitorUpdaterPlugin)
16
16
  public class CapacitorUpdaterPlugin: CAPPlugin {
17
17
  private var implementation = CapacitorUpdater()
18
- private let PLUGIN_VERSION: String = "5.2.12"
18
+ private let PLUGIN_VERSION: String = "5.2.13"
19
19
  static let updateUrlDefault = "https://api.capgo.app/updates"
20
20
  static let statsUrlDefault = "https://api.capgo.app/stats"
21
21
  static let channelUrlDefault = "https://api.capgo.app/channel_self"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "5.2.12",
3
+ "version": "5.2.13",
4
4
  "packageManager": "pnpm@8.6.12",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",