Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit c1be128

Browse files
committed
ios
1 parent 05697c4 commit c1be128

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

CodePush.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ - (instancetype)init
106106
}
107107

108108
/*
109-
* This method starts the rollback protection timer
110-
* and is used when a new update is initialized.
109+
* This method is used when the app is started to either
110+
* initialize a pending update or rollback a faulty update
111+
* to the previous version.
111112
*/
112113
- (void)initializeUpdateAfterRestart
113114
{
@@ -122,7 +123,7 @@ - (void)initializeUpdateAfterRestart
122123
// Therefore, deduce that it is a broken update and rollback.
123124
[self rollbackPackage];
124125
} else {
125-
// Mark that we tried to initiazlie the new update, so that if it crashes,
126+
// Mark that we tried to initialize the new update, so that if it crashes,
126127
// we will know that we need to rollback when the app next starts.
127128
[self savePendingUpdate:pendingUpdate[PendingUpdateHashKey]
128129
wasInitialized:YES];
@@ -174,10 +175,9 @@ - (void)rollbackPackage
174175
// Write the current package's hash to the "failed list"
175176
[self saveFailedUpdate:packageHash];
176177

177-
// Do the actual rollback and then
178-
// refresh the app with the previous package
178+
// Rollback to the previous version and de-register the new update
179+
[CodePushPackage rollbackPackage];
179180
[self removePendingUpdate];
180-
[self loadBundle];
181181
}
182182

183183
/*

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ private void rollbackPackage() {
160160
}
161161

162162
removePendingUpdate();
163-
if (codePushNativeModule != null) {
164-
codePushNativeModule.loadBundle();
165-
}
166163
}
167164

168165
private void saveFailedUpdate(String packageHash) {
@@ -236,7 +233,7 @@ private void initializeUpdateAfterRestart() {
236233
// Therefore, deduce that it is a broken update and rollback.
237234
rollbackPackage();
238235
} else {
239-
// Mark that we tried to initiazlie the new update, so that if it crashes,
236+
// Mark that we tried to initialize the new update, so that if it crashes,
240237
// we will know that we need to rollback when the app next starts.
241238
savePendingUpdate(pendingUpdate.getString(PENDING_UPDATE_HASH_KEY),
242239
/* wasInitialized */true);

0 commit comments

Comments
 (0)