@onekeyfe/react-native-bundle-update 1.1.44 → 1.1.45
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/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt
CHANGED
|
@@ -278,10 +278,17 @@ object BundleUpdateStoreAndroid {
|
|
|
278
278
|
val nextRetryAt = taskObj.optLong("nextRetryAt", 0)
|
|
279
279
|
if (nextRetryAt > 0 && nextRetryAt > now) return
|
|
280
280
|
|
|
281
|
-
// 3. Verify scheduledEnv matches current state
|
|
281
|
+
// 3. Verify scheduledEnv matches current state (including buildNumber)
|
|
282
282
|
val currentAppVersion = getAppVersion(context) ?: return
|
|
283
283
|
if (taskObj.optString("scheduledEnvAppVersion") != currentAppVersion) return
|
|
284
284
|
|
|
285
|
+
val prevBuildNumber = getNativeBuildNumber(context)
|
|
286
|
+
val currentBuildNumber = getBuildNumber(context)
|
|
287
|
+
if (prevBuildNumber.isNotEmpty() && currentBuildNumber.isNotEmpty() && prevBuildNumber != currentBuildNumber) {
|
|
288
|
+
OneKeyLog.info("BundleUpdate", "processPreLaunchPendingTask: buildNumber changed from $prevBuildNumber to $currentBuildNumber, skipping stale task")
|
|
289
|
+
return
|
|
290
|
+
}
|
|
291
|
+
|
|
285
292
|
val currentBV = getCurrentBundleVersion(context)
|
|
286
293
|
val currentBundleVersionStr = if (currentBV != null) {
|
|
287
294
|
val idx = currentBV.lastIndexOf("-")
|
|
@@ -236,10 +236,17 @@ public class BundleUpdateStore: NSObject {
|
|
|
236
236
|
if nextRetryAtNum.int64Value > now { return }
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
// 3. Verify scheduledEnv matches current state
|
|
239
|
+
// 3. Verify scheduledEnv matches current state (including buildNumber)
|
|
240
240
|
let currentAppVersion = getCurrentNativeVersion()
|
|
241
241
|
guard taskDict["scheduledEnvAppVersion"] as? String == currentAppVersion else { return }
|
|
242
242
|
|
|
243
|
+
let prevBuildNumber = getNativeBuildNumber() ?? ""
|
|
244
|
+
let currentBuildNumber = getCurrentNativeBuildNumber()
|
|
245
|
+
if !prevBuildNumber.isEmpty && !currentBuildNumber.isEmpty && prevBuildNumber != currentBuildNumber {
|
|
246
|
+
OneKeyLog.info("BundleUpdate", "processPreLaunchPendingTask: buildNumber changed from \(prevBuildNumber) to \(currentBuildNumber), skipping stale task")
|
|
247
|
+
return
|
|
248
|
+
}
|
|
249
|
+
|
|
243
250
|
let currentBundleVersionStr: String
|
|
244
251
|
if let cbv = currentBundleVersion(),
|
|
245
252
|
let dashRange = cbv.range(of: "-", options: .backwards) {
|