react-native-update 10.36.0 → 10.36.2

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.
@@ -44,13 +44,17 @@ public class UpdateContext {
44
44
  String storedPackageVersion = this.sp.getString("packageVersion", null);
45
45
  String storedBuildTime = this.sp.getString("buildTime", null);
46
46
 
47
- // If stored versions don't exist, write current versions first
48
- if (storedPackageVersion == null || storedBuildTime == null) {
49
- SharedPreferences.Editor editor = sp.edit();
47
+
48
+ SharedPreferences.Editor editor = this.sp.edit();
49
+ if (storedPackageVersion == null) {
50
50
  editor.putString("packageVersion", packageVersion);
51
- editor.putString("buildTime", buildTime);
52
51
  editor.apply();
53
52
  storedPackageVersion = packageVersion;
53
+ }
54
+
55
+ if (storedBuildTime == null) {
56
+ editor.putString("buildTime", buildTime);
57
+ editor.apply();
54
58
  storedBuildTime = buildTime;
55
59
  }
56
60
 
@@ -60,15 +64,10 @@ public class UpdateContext {
60
64
  if (packageVersionChanged || buildTimeChanged) {
61
65
  // Execute cleanUp before clearing SharedPreferences to avoid race condition
62
66
  this.cleanUp();
63
-
64
- SharedPreferences.Editor editor = sp.edit();
65
67
  editor.clear();
66
68
  editor.putString("packageVersion", packageVersion);
67
69
  editor.putString("buildTime", buildTime);
68
- // Use commit() instead of apply() to ensure synchronous write completion
69
- // This prevents race condition where getBundleUrl() might read null values
70
- // if called before apply() completes
71
- editor.commit();
70
+ editor.apply();
72
71
  }
73
72
  }
74
73
 
@@ -78,10 +78,13 @@ RCT_EXPORT_MODULE(RCTPushy);
78
78
  NSString *storedBuildTime = [defaults stringForKey:paramBuildTime];
79
79
 
80
80
  // If stored versions don't exist, write current versions first
81
- if (!storedPackageVersion && !storedBuildTime) {
81
+ if (!storedPackageVersion) {
82
82
  [defaults setObject:curPackageVersion forKey:paramPackageVersion];
83
- [defaults setObject:curBuildTime forKey:paramBuildTime];
84
83
  storedPackageVersion = curPackageVersion;
84
+ }
85
+
86
+ if (!storedBuildTime) {
87
+ [defaults setObject:curBuildTime forKey:paramBuildTime];
85
88
  storedBuildTime = curBuildTime;
86
89
  }
87
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.36.0",
3
+ "version": "10.36.2",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {