@otakit/capacitor-updater 2.3.0 → 2.3.1

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
@@ -162,6 +162,11 @@ If a bundle is applied and never calls `notifyAppReady()`:
162
162
  The last failed applied bundle is persisted so the plugin does not immediately
163
163
  download and apply the same broken release again.
164
164
 
165
+ On top of this per-device rollback, a release published with the auto-revert
166
+ flag is reverted fleet-wide by the server when too many devices report
167
+ rollbacks within a 24-hour window, so remaining devices never download the
168
+ broken bundle.
169
+
165
170
  ## Automatic flow
166
171
 
167
172
  For the normal hosted path, most apps only need:
@@ -206,16 +206,23 @@ final class DeltaAssembler {
206
206
  }
207
207
  try fileManager.createDirectory(at: destination, withIntermediateDirectories: true)
208
208
 
209
- let destinationPrefix = destination.standardizedFileURL.path.hasSuffix("/")
210
- ? destination.standardizedFileURL.path
211
- : destination.standardizedFileURL.path + "/"
209
+ // Resolve the destination's symlinks ONCE and derive every target from the
210
+ // resolved base. iOS's temp dir is /var/… (a symlink to /private/var/…);
211
+ // standardizedFileURL resolved it inconsistently between the base and the
212
+ // appended path, so the containment check compared /var vs /private/var and
213
+ // rejected every file. Building targets from the already-resolved base makes
214
+ // the prefix check exact (mirrors Android's getCanonicalPath() on both sides).
215
+ let canonicalDestination = destination.resolvingSymlinksInPath()
216
+ let destinationPrefix = canonicalDestination.path.hasSuffix("/")
217
+ ? canonicalDestination.path
218
+ : canonicalDestination.path + "/"
212
219
 
213
220
  for entry in entries {
214
221
  try await ensureCached(entry)
215
222
 
216
- let target = destination.appendingPathComponent(entry.path, isDirectory: false)
223
+ let target = canonicalDestination.appendingPathComponent(entry.path, isDirectory: false)
217
224
  // Defense in depth alongside isValidEntryPath (mirrors ZipUtils).
218
- guard target.standardizedFileURL.path.hasPrefix(destinationPrefix) else {
225
+ guard target.path.hasPrefix(destinationPrefix) else {
219
226
  throw DeltaAssemblerError.invalidPath(entry.path)
220
227
  }
221
228
  let parent = target.deletingLastPathComponent()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otakit/capacitor-updater",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Capacitor plugin for OTA updates",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",