expo-modules-core 3.0.28 → 3.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 CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 3.0.29 — 2025-12-12
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [Android] check if `AppContextActivityResultLauncher` coroutine continuation is active before resuming ([#41319](https://github.com/expo/expo/pull/41319) by [@vonovak](https://github.com/vonovak))
18
+
13
19
  ## 3.0.28 — 2025-12-05
14
20
 
15
21
  _This version does not introduce any user-facing changes._
@@ -29,7 +29,7 @@ if (shouldIncludeCompose) {
29
29
  }
30
30
 
31
31
  group = 'host.exp.exponent'
32
- version = '3.0.28'
32
+ version = '3.0.29'
33
33
 
34
34
  def isExpoModulesCoreTests = {
35
35
  Gradle gradle = getGradle()
@@ -79,7 +79,7 @@ android {
79
79
  defaultConfig {
80
80
  consumerProguardFiles 'proguard-rules.pro'
81
81
  versionCode 1
82
- versionName "3.0.28"
82
+ versionName "3.0.29"
83
83
  buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
84
84
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
85
85
 
@@ -3,8 +3,8 @@ package expo.modules.kotlin.activityresult
3
3
  import androidx.activity.result.ActivityResultCallback
4
4
  import androidx.activity.result.contract.ActivityResultContract
5
5
  import java.io.Serializable
6
+ import kotlinx.coroutines.suspendCancellableCoroutine
6
7
  import kotlin.coroutines.resume
7
- import kotlin.coroutines.suspendCoroutine
8
8
 
9
9
  /**
10
10
  * A launcher for a previously-[AppContextActivityResultCaller.registerForActivityResult] prepared call
@@ -22,8 +22,13 @@ abstract class AppContextActivityResultLauncher<I : Serializable, O> {
22
22
  */
23
23
  abstract fun launch(input: I, callback: ActivityResultCallback<O>)
24
24
 
25
- suspend fun launch(input: I): O = suspendCoroutine { continuation ->
26
- launch(input) { output -> continuation.resume(output) }
25
+ suspend fun launch(input: I): O = suspendCancellableCoroutine { continuation ->
26
+ launch(input) { output ->
27
+ // avoids IllegalStateException: Already resumed - a rare crash likely due to race condition in lifecycle events
28
+ if (continuation.isActive) {
29
+ continuation.resume(output)
30
+ }
31
+ }
27
32
  }
28
33
 
29
34
  abstract val contract: AppContextActivityResultContract<I, O>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "3.0.28",
3
+ "version": "3.0.29",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
@@ -65,5 +65,5 @@
65
65
  "@testing-library/react-native": "^13.2.0",
66
66
  "expo-module-scripts": "^5.0.8"
67
67
  },
68
- "gitHead": "172a69f5f70c1d0e043e1532f924de97210cabc3"
68
+ "gitHead": "599ebc94db5c972f961641db9aa33e2964498c42"
69
69
  }