@capgo/capacitor-updater 8.43.6 → 8.43.8

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.
@@ -30,7 +30,7 @@ android {
30
30
  buildTypes {
31
31
  release {
32
32
  minifyEnabled false
33
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
33
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
34
34
  }
35
35
  }
36
36
  lintOptions {
@@ -84,7 +84,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
84
84
  private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
85
85
  private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
86
86
 
87
- private final String pluginVersion = "8.43.6";
87
+ private final String pluginVersion = "8.43.8";
88
88
  private static final String DELAY_CONDITION_PREFERENCES = "";
89
89
 
90
90
  private SharedPreferences.Editor editor;
@@ -72,7 +72,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
72
72
  CAPPluginMethod(name: "completeFlexibleUpdate", returnType: CAPPluginReturnPromise)
73
73
  ]
74
74
  public var implementation = CapgoUpdater()
75
- private let pluginVersion: String = "8.43.6"
75
+ private let pluginVersion: String = "8.43.8"
76
76
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
77
77
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
78
78
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -578,10 +578,36 @@ import UIKit
578
578
  for entry in manifest {
579
579
  guard let fileName = entry.file_name,
580
580
  let downloadUrl = entry.download_url else {
581
+ let error = NSError(
582
+ domain: "ManifestEntryError",
583
+ code: 1,
584
+ userInfo: [
585
+ NSLocalizedDescriptionKey: "Manifest entry is missing file_name or download_url",
586
+ ]
587
+ )
588
+ errorLock.lock()
589
+ if downloadError == nil {
590
+ downloadError = error
591
+ }
592
+ errorLock.unlock()
593
+ hasError.value = true
594
+ logger.error("Manifest entry is missing file_name or download_url")
581
595
  continue
582
596
  }
583
597
  guard let entryFileHash = entry.file_hash, !entryFileHash.isEmpty else {
584
598
  logger.error("Missing file_hash for manifest entry: \(entry.file_name ?? "unknown")")
599
+ let error = NSError(
600
+ domain: "ManifestEntryError",
601
+ code: 2,
602
+ userInfo: [
603
+ NSLocalizedDescriptionKey: "Manifest entry is missing file_hash for \(entry.file_name ?? "unknown")",
604
+ ]
605
+ )
606
+ errorLock.lock()
607
+ if downloadError == nil {
608
+ downloadError = error
609
+ }
610
+ errorLock.unlock()
585
611
  hasError.value = true
586
612
  continue
587
613
  }
@@ -670,11 +696,16 @@ import UIKit
670
696
  // Execute all operations concurrently and wait for completion
671
697
  manifestDownloadQueue.addOperations(operations, waitUntilFinished: true)
672
698
 
673
- if hasError.value, let error = downloadError {
699
+ if hasError.value {
700
+ let resolvedError = downloadError ?? NSError(
701
+ domain: "ManifestDownloadError",
702
+ code: 1,
703
+ userInfo: [NSLocalizedDescriptionKey: "Manifest download failed due to invalid or missing entries"]
704
+ )
674
705
  // Update bundle status to ERROR if download failed
675
706
  let errorBundle = bundleInfo.setStatus(status: BundleStatus.ERROR.localizedString)
676
707
  self.saveBundleInfo(id: id, bundle: errorBundle)
677
- throw error
708
+ throw resolvedError
678
709
  }
679
710
 
680
711
  // Update bundle status to PENDING after successful download
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "8.43.6",
3
+ "version": "8.43.8",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",