@capgo/capacitor-updater 8.43.5 → 8.43.7
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.
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ Perfect for fixing bugs immediately, A/B testing features, and maintaining contr
|
|
|
50
50
|
- ⚔️ **Battle-Tested**: Used in more than 3000 projects.
|
|
51
51
|
- 📊 View your deployment statistics
|
|
52
52
|
- 🔋 Supports Android and iOS
|
|
53
|
-
- ⚡️ Capacitor 6/7 support
|
|
53
|
+
- ⚡️ Capacitor 4/5/6/7/8 support
|
|
54
54
|
- 🌐 **Open Source**: Licensed under the Mozilla Public License 2.0
|
|
55
55
|
- 🌐 **Open Source Backend**: Self install [our backend](https://github.com/Cap-go/capgo) in your infra
|
|
56
56
|
|
|
@@ -96,11 +96,11 @@ Starting from v8, the plugin uses [ZIPFoundation](https://github.com/weichsel/ZI
|
|
|
96
96
|
| v7.\*.\* | v7.\*.\* | ✅ |
|
|
97
97
|
| v6.\*.\* | v6.\*.\* | ✅ |
|
|
98
98
|
| v5.\*.\* | v5.\*.\* | ✅ |
|
|
99
|
-
| v4.\*.\* | v4.\*.\* |
|
|
99
|
+
| v4.\*.\* | v4.\*.\* | ✅ |
|
|
100
100
|
| v3.\*.\* | v3.\*.\* | ⚠️ Deprecated |
|
|
101
101
|
| > 7 | v4.\*.\* | ⚠️ Deprecated, our CI got crazy and bumped too much version |
|
|
102
102
|
|
|
103
|
-
> **Note:** Versions 5, 6, 7, and 8 all share the same features. The major version simply follows your Capacitor version. You can safely use any of these versions that matches your Capacitor installation.
|
|
103
|
+
> **Note:** Versions 4, 5, 6, 7, and 8 all share the same features. The major version simply follows your Capacitor version. You can safely use any of these versions that matches your Capacitor installation.
|
|
104
104
|
|
|
105
105
|
### iOS
|
|
106
106
|
|
|
@@ -158,6 +158,9 @@ npm install @capgo/capacitor-updater@lts-v6
|
|
|
158
158
|
|
|
159
159
|
# For Capacitor 5
|
|
160
160
|
npm install @capgo/capacitor-updater@lts-v5
|
|
161
|
+
|
|
162
|
+
# For Capacitor 4
|
|
163
|
+
npm install @capgo/capacitor-updater@lts-v4
|
|
161
164
|
```
|
|
162
165
|
|
|
163
166
|
## Auto-update setup
|
|
@@ -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.
|
|
87
|
+
private final String pluginVersion = "8.43.7";
|
|
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.
|
|
75
|
+
private let pluginVersion: String = "8.43.7"
|
|
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
|
|
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
|
|
708
|
+
throw resolvedError
|
|
678
709
|
}
|
|
679
710
|
|
|
680
711
|
// Update bundle status to PENDING after successful download
|