expo-updates 57.0.27 → 57.0.29
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/CHANGELOG.md +12 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/updates/EnabledUpdatesController.kt +2 -2
- package/android/src/main/java/expo/modules/updates/procedures/CheckForUpdateProcedure.kt +9 -3
- package/android/src/main/java/expo/modules/updates/procedures/FetchUpdateProcedure.kt +6 -5
- package/android/src/main/java/expo/modules/updates/statemachine/UpdatesStateMachine.kt +7 -1
- package/ios/EXUpdates/UpdatesStateMachine.swift +6 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 57.0.29 — 2026-11-23
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- [Android] Fix `checkForUpdateAsync()` and `fetchUpdateAsync()` queued behind `reloadAsync()` comparing with the update that was running before the reload, so a check reported the running update as available. ([#53055](https://github.com/expo/expo/pull/53055) by [@douglowder](https://github.com/douglowder))
|
|
18
|
+
|
|
19
|
+
## 57.0.28 — 2026-11-12
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
|
+
|
|
23
|
+
- Send download progress to JavaScript in 1% steps, so updates with many assets no longer use a large amount of memory while they download. ([#53250](https://github.com/expo/expo/pull/53250) by [@alanjhughes](https://github.com/alanjhughes))
|
|
24
|
+
|
|
13
25
|
## 57.0.27 — 2026-11-05
|
|
14
26
|
|
|
15
27
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
|
@@ -42,7 +42,7 @@ expoModule {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
group = 'host.exp.exponent'
|
|
45
|
-
version = '57.0.
|
|
45
|
+
version = '57.0.29'
|
|
46
46
|
|
|
47
47
|
// Utility method to derive boolean values from the environment or from Java properties,
|
|
48
48
|
// and return them as strings to be used in BuildConfig fields
|
|
@@ -94,7 +94,7 @@ android {
|
|
|
94
94
|
namespace "expo.modules.updates"
|
|
95
95
|
defaultConfig {
|
|
96
96
|
versionCode 31
|
|
97
|
-
versionName '57.0.
|
|
97
|
+
versionName '57.0.29'
|
|
98
98
|
consumerProguardFiles("proguard-rules.pro")
|
|
99
99
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
100
100
|
|
|
@@ -255,14 +255,14 @@ class EnabledUpdatesController(
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
override suspend fun checkForUpdate() = suspendCancellableCoroutine { continuation ->
|
|
258
|
-
val procedure = CheckForUpdateProcedure(context, updatesConfiguration, databaseHolder, logger, fileDownloader, selectionPolicy, launchedUpdate) {
|
|
258
|
+
val procedure = CheckForUpdateProcedure(context, updatesConfiguration, databaseHolder, logger, fileDownloader, selectionPolicy, { launchedUpdate }) {
|
|
259
259
|
continuation.resume(it)
|
|
260
260
|
}
|
|
261
261
|
stateMachine.queueExecution(procedure)
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
override suspend fun fetchUpdate() = suspendCancellableCoroutine { continuation ->
|
|
265
|
-
val procedure = FetchUpdateProcedure(context, updatesConfiguration, logger, databaseHolder, updatesDirectory, fileDownloader, selectionPolicy, launchedUpdate, controllerScope) {
|
|
265
|
+
val procedure = FetchUpdateProcedure(context, updatesConfiguration, logger, databaseHolder, updatesDirectory, fileDownloader, selectionPolicy, { launchedUpdate }, controllerScope) {
|
|
266
266
|
continuation.resume(it)
|
|
267
267
|
}
|
|
268
268
|
stateMachine.queueExecution(procedure)
|
|
@@ -24,13 +24,14 @@ class CheckForUpdateProcedure(
|
|
|
24
24
|
private val updatesLogger: UpdatesLogger,
|
|
25
25
|
private val fileDownloader: FileDownloader,
|
|
26
26
|
private val selectionPolicy: SelectionPolicy,
|
|
27
|
-
private val
|
|
27
|
+
private val getLaunchedUpdate: () -> UpdateEntity?,
|
|
28
28
|
private val callback: (IUpdatesController.CheckForUpdateResult) -> Unit
|
|
29
29
|
) : StateMachineProcedure() {
|
|
30
30
|
override val loggerTimerLabel = "timer-check-for-update"
|
|
31
31
|
|
|
32
32
|
override suspend fun run(procedureContext: ProcedureContext) {
|
|
33
33
|
procedureContext.processStateEvent(UpdatesStateEvent.Check())
|
|
34
|
+
val launchedUpdate = getLaunchedUpdate()
|
|
34
35
|
|
|
35
36
|
val embeddedUpdate = EmbeddedManifestUtils.getEmbeddedUpdate(context, updatesConfiguration)?.updateEntity
|
|
36
37
|
val extraHeaders = FileDownloader.getExtraHeadersForRemoteUpdateRequest(
|
|
@@ -42,7 +43,7 @@ class CheckForUpdateProcedure(
|
|
|
42
43
|
|
|
43
44
|
try {
|
|
44
45
|
val updateResponse = downloadRemoteUpdate(extraHeaders)
|
|
45
|
-
processUpdatesResponse(updateResponse, procedureContext, embeddedUpdate)
|
|
46
|
+
processUpdatesResponse(updateResponse, procedureContext, embeddedUpdate, launchedUpdate)
|
|
46
47
|
} catch (e: CancellationException) {
|
|
47
48
|
throw e
|
|
48
49
|
} catch (e: Exception) {
|
|
@@ -61,7 +62,12 @@ class CheckForUpdateProcedure(
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
private fun processUpdatesResponse(
|
|
65
|
+
private fun processUpdatesResponse(
|
|
66
|
+
updateResponse: UpdateResponse,
|
|
67
|
+
procedureContext: ProcedureContext,
|
|
68
|
+
embeddedUpdate: UpdateEntity?,
|
|
69
|
+
launchedUpdate: UpdateEntity?
|
|
70
|
+
) {
|
|
65
71
|
val updateDirective = updateResponse.directiveUpdateResponsePart?.updateDirective
|
|
66
72
|
val update = updateResponse.manifestUpdateResponsePart?.update
|
|
67
73
|
|
|
@@ -25,7 +25,7 @@ class FetchUpdateProcedure(
|
|
|
25
25
|
private val updatesDirectory: File,
|
|
26
26
|
private val fileDownloader: FileDownloader,
|
|
27
27
|
private val selectionPolicy: SelectionPolicy,
|
|
28
|
-
private val
|
|
28
|
+
private val getLaunchedUpdate: () -> UpdateEntity?,
|
|
29
29
|
private val scope: CoroutineScope,
|
|
30
30
|
private val callback: (IUpdatesController.FetchUpdateResult) -> Unit
|
|
31
31
|
) : StateMachineProcedure() {
|
|
@@ -33,11 +33,12 @@ class FetchUpdateProcedure(
|
|
|
33
33
|
|
|
34
34
|
override suspend fun run(procedureContext: ProcedureContext) {
|
|
35
35
|
procedureContext.processStateEvent(UpdatesStateEvent.Download())
|
|
36
|
+
val launchedUpdate = getLaunchedUpdate()
|
|
36
37
|
|
|
37
38
|
val database = databaseHolder.database
|
|
38
39
|
try {
|
|
39
|
-
val loaderResult = startRemoteLoader(database, procedureContext)
|
|
40
|
-
processSuccessLoaderResult(loaderResult, procedureContext)
|
|
40
|
+
val loaderResult = startRemoteLoader(database, procedureContext, launchedUpdate)
|
|
41
|
+
processSuccessLoaderResult(loaderResult, procedureContext, launchedUpdate)
|
|
41
42
|
} catch (e: CancellationException) {
|
|
42
43
|
throw e
|
|
43
44
|
} catch (e: Exception) {
|
|
@@ -51,7 +52,7 @@ class FetchUpdateProcedure(
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
private suspend fun startRemoteLoader(database: UpdatesDatabase, procedureContext: ProcedureContext): Loader.LoaderResult {
|
|
55
|
+
private suspend fun startRemoteLoader(database: UpdatesDatabase, procedureContext: ProcedureContext, launchedUpdate: UpdateEntity?): Loader.LoaderResult {
|
|
55
56
|
val remoteLoader = RemoteLoader(
|
|
56
57
|
context,
|
|
57
58
|
updatesConfiguration,
|
|
@@ -98,7 +99,7 @@ class FetchUpdateProcedure(
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
private suspend fun processSuccessLoaderResult(loaderResult: Loader.LoaderResult, procedureContext: ProcedureContext) {
|
|
102
|
+
private suspend fun processSuccessLoaderResult(loaderResult: Loader.LoaderResult, procedureContext: ProcedureContext, launchedUpdate: UpdateEntity?) {
|
|
102
103
|
val result = RemoteLoader.processSuccessLoaderResult(
|
|
103
104
|
context,
|
|
104
105
|
updatesConfiguration,
|
|
@@ -10,6 +10,7 @@ import expo.modules.updatesinterface.UpdatesControllerRegistry
|
|
|
10
10
|
import kotlinx.coroutines.CoroutineScope
|
|
11
11
|
import kotlinx.coroutines.Dispatchers
|
|
12
12
|
import java.util.Date
|
|
13
|
+
import kotlin.math.floor
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The Updates state machine class. There should be only one instance of this class
|
|
@@ -92,6 +93,7 @@ class UpdatesStateMachine(
|
|
|
92
93
|
*/
|
|
93
94
|
private fun processEvent(event: UpdatesStateEvent) {
|
|
94
95
|
if (transition(event)) {
|
|
96
|
+
val previousProgress = context.downloadProgress
|
|
95
97
|
context = reduceContext(context, event)
|
|
96
98
|
if (event !is UpdatesStateEvent.DownloadProgress) {
|
|
97
99
|
logger.info("Updates state change: ${event.type}, context = ${context.json}")
|
|
@@ -104,7 +106,9 @@ class UpdatesStateMachine(
|
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
|
-
|
|
109
|
+
if (event !is UpdatesStateEvent.DownloadProgress || floor(context.downloadProgress * 100) != floor(previousProgress * 100)) {
|
|
110
|
+
sendContextToJS()
|
|
111
|
+
}
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
|
|
@@ -224,12 +228,14 @@ class UpdatesStateMachine(
|
|
|
224
228
|
isDownloading = false,
|
|
225
229
|
downloadError = null,
|
|
226
230
|
isUpdatePending = true,
|
|
231
|
+
downloadProgress = 1.0,
|
|
227
232
|
downloadStartTime = null,
|
|
228
233
|
downloadFinishTime = null
|
|
229
234
|
)
|
|
230
235
|
is UpdatesStateEvent.DownloadCompleteWithUpdate -> context.copyAndIncrementSequenceNumber(
|
|
231
236
|
isDownloading = false,
|
|
232
237
|
downloadError = null,
|
|
238
|
+
downloadProgress = 1.0,
|
|
233
239
|
latestManifest = event.manifest,
|
|
234
240
|
downloadedManifest = event.manifest,
|
|
235
241
|
rollback = null,
|
|
@@ -393,6 +393,7 @@ internal class UpdatesStateMachine {
|
|
|
393
393
|
private func processEvent(_ event: UpdatesStateEvent) {
|
|
394
394
|
// Execute state transition
|
|
395
395
|
if transition(event) {
|
|
396
|
+
let previousProgress = context.downloadProgress
|
|
396
397
|
// Only change context if transition succeeds
|
|
397
398
|
context = reducedContext(context, event)
|
|
398
399
|
if event.type != .downloadProgress {
|
|
@@ -406,7 +407,9 @@ internal class UpdatesStateMachine {
|
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
}
|
|
409
|
-
|
|
410
|
+
if event.type != .downloadProgress || (context.downloadProgress * 100).rounded(.down) != (previousProgress * 100).rounded(.down) {
|
|
411
|
+
sendContextToJS()
|
|
412
|
+
}
|
|
410
413
|
}
|
|
411
414
|
}
|
|
412
415
|
internal func processEventForTesting(_ event: UpdatesStateEvent) {
|
|
@@ -510,6 +513,7 @@ internal class UpdatesStateMachine {
|
|
|
510
513
|
$0.isDownloading = false
|
|
511
514
|
$0.downloadError = nil
|
|
512
515
|
$0.isUpdatePending = true
|
|
516
|
+
$0.downloadProgress = 1.0
|
|
513
517
|
$0.downloadStartTime = nil
|
|
514
518
|
$0.downloadFinishTime = nil
|
|
515
519
|
}
|
|
@@ -517,6 +521,7 @@ internal class UpdatesStateMachine {
|
|
|
517
521
|
return context.copyAndIncrementSequenceNumber {
|
|
518
522
|
$0.isDownloading = false
|
|
519
523
|
$0.downloadError = nil
|
|
524
|
+
$0.downloadProgress = 1.0
|
|
520
525
|
$0.latestManifest = manifest
|
|
521
526
|
$0.downloadedManifest = manifest
|
|
522
527
|
$0.rollback = nil
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.29",
|
|
4
4
|
"description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"ts-node": "^10.9.2",
|
|
62
62
|
"xstate": "^4.37.2",
|
|
63
63
|
"expo-module-scripts": "56.0.3",
|
|
64
|
-
"expo
|
|
65
|
-
"expo": "57.0.
|
|
64
|
+
"expo": "57.0.34",
|
|
65
|
+
"expo-dev-client": "57.0.22",
|
|
66
66
|
"@expo/metro-config": "57.0.14"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"./scripts/with-node.sh"
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "14616b4ffe6167019952be745310f563d15bf68a",
|
|
86
86
|
"scripts": {
|
|
87
87
|
"build": "expo-module build",
|
|
88
88
|
"clean": "expo-module clean",
|