Skip to content

Commit

Permalink
fix: try delete builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 28, 2022
1 parent 0a65adb commit df6f8bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ private void checkRevert() {
this.implementation.sendStats("update_fail", current.getVersionName());
this.implementation.setError(current);
this._reset(true);
if (CapacitorUpdaterPlugin.this.autoDeleteFailed) {
if (CapacitorUpdaterPlugin.this.autoDeleteFailed && !current.isBuiltin()) {
Log.i(CapacitorUpdater.TAG, "Deleting failing bundle: " + current.getVersionName());
try {
final Boolean res = this.implementation.delete(current.getId(), false);
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ extension CustomError: LocalizedError {
let fallback: BundleInfo = self.getFallbackBundle()
print("\(self.TAG) Fallback bundle is: \(fallback.toString())")
print("\(self.TAG) Version successfully loaded: \(bundle.toString())")
if(autoDeletePrevious) {
if(autoDeletePrevious && !fallback.isBuiltin()) {
let res = self.delete(id: fallback.getId())
if (res) {
print("\(self.TAG) Deleted previous bundle: \(fallback.toString())")
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
self.implementation.sendStats(action: "update_fail", versionName: current.getVersionName())
self.implementation.setError(bundle: current)
_ = self._reset(toLastSuccessful: true)
if (self.autoDeleteFailed) {
if (self.autoDeleteFailed && !current.isBuiltin()) {
print("\(self.implementation.TAG) Deleting failing bundle: \(current.toString())")
let res = self.implementation.delete(id: current.getId(), removeInfo: false)
if (!res) {
Expand Down

0 comments on commit df6f8bb

Please sign in to comment.