This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
android/app/src/main/java/com/microsoft/codepush/react Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ async function checkForUpdate(deploymentKey = null) {
70
70
* because we want to avoid having to install diff updates against the binary's
71
71
* version, which we can't do yet on Android.
72
72
*/
73
- if ( ! update || update . updateAppVersion || localPackage && ( update . packageHash === localPackage . packageHash ) || ! localPackage && config . packageHash === update . packageHash ) {
73
+ if ( ! update || update . updateAppVersion ||
74
+ localPackage && ( update . packageHash === localPackage . packageHash ) ||
75
+ ( ! localPackage || localPackage . _isDebugOnly ) && config . packageHash === update . packageHash ) {
74
76
if ( update && update . updateAppVersion ) {
75
77
log ( "An update is available but it is targeting a newer binary version than you are currently running." ) ;
76
78
}
Original file line number Diff line number Diff line change @@ -423,6 +423,10 @@ protected Void doInBackground(Object... params) {
423
423
return null ;
424
424
}
425
425
426
+ if (isRunningBinaryVersion ) {
427
+ currentPackage .putBoolean ("_isDebugOnly" , true );
428
+ }
429
+
426
430
Boolean isPendingUpdate = false ;
427
431
428
432
if (currentPackage .hasKey (codePushPackage .PACKAGE_HASH_KEY )) {
Original file line number Diff line number Diff line change @@ -480,6 +480,13 @@ - (void)savePendingUpdate:(NSString *)packageHash
480
480
return ;
481
481
}
482
482
483
+ if (isRunningBinaryVersion) {
484
+ // This only matters in Debug builds. Since we do not clear "outdated" updates,
485
+ // we need to indicate to the JS side that somehow we have a current update on
486
+ // disk that is not actually running.
487
+ [package setObject: @(YES ) forKey: @" _isDebugOnly" ];
488
+ }
489
+
483
490
// Add the "isPending" virtual property to the package at this point, so that
484
491
// the script-side doesn't need to immediately call back into native to populate it.
485
492
BOOL isPendingUpdate = [self isPendingUpdate: [package objectForKey: PackageHashKey]];
You can’t perform that action at this time.
0 commit comments