fix(mobile): expo-video bez NoSuchElementException przy zamykaniu serwisu
toList() na values ConcurrentHashMap przy rozmiarze 1 robi iterator().next(); gdy sesja zniknie miedzy size() i next(), leci NoSuchElementException (0.4.2, GOON-72). ArrayList(values) idzie przez toArray(), ktore mapa robi bezpiecznie. Natywne, czeka na nastepne APK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
d3713d64b9
commit
f33f37f117
1 changed files with 6 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt b/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt b/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
||||||
|
index cd798cf..8cb6dfb 100644
|
||||||
--- a/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
--- a/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
||||||
+++ b/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
+++ b/node_modules/expo-video/android/src/main/java/expo/modules/video/playbackService/ExpoVideoPlaybackService.kt
|
||||||
@@ -26,7 +26,7 @@ class PlaybackServiceBinder(val service: ExpoVideoPlaybackService) : Binder()
|
@@ -26,7 +26,7 @@ class PlaybackServiceBinder(val service: ExpoVideoPlaybackService) : Binder()
|
||||||
|
|
@ -10,7 +11,7 @@ diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/pl
|
||||||
private val binder = PlaybackServiceBinder(this)
|
private val binder = PlaybackServiceBinder(this)
|
||||||
|
|
||||||
private val commandSeekForward = SessionCommand(SEEK_FORWARD_COMMAND, Bundle.EMPTY)
|
private val commandSeekForward = SessionCommand(SEEK_FORWARD_COMMAND, Bundle.EMPTY)
|
||||||
@@ -136,10 +136,17 @@ class ExpoVideoPlaybackService : MediaSessionService() {
|
@@ -136,10 +136,20 @@ class ExpoVideoPlaybackService : MediaSessionService() {
|
||||||
|
|
||||||
private fun cleanup() {
|
private fun cleanup() {
|
||||||
hideAllNotifications()
|
hideAllNotifications()
|
||||||
|
|
@ -21,7 +22,10 @@ diff --git a/node_modules/expo-video/android/src/main/java/expo/modules/video/pl
|
||||||
+ // Mapa jest ConcurrentHashMap (patrz deklaracja), bo sama kopia tez iteruje mape,
|
+ // Mapa jest ConcurrentHashMap (patrz deklaracja), bo sama kopia tez iteruje mape,
|
||||||
+ // a wpisy znikaja z innego watku przy zwalnianiu playera: na LinkedHashMap `toList()`
|
+ // a wpisy znikaja z innego watku przy zwalnianiu playera: na LinkedHashMap `toList()`
|
||||||
+ // wywalalo sie wtedy tak samo (Goon 0.4.1, Sentry GOON-6W, 2026-09-17).
|
+ // wywalalo sie wtedy tak samo (Goon 0.4.1, Sentry GOON-6W, 2026-09-17).
|
||||||
+ val sessions = mediaSessions.values.toList()
|
+ // ArrayList(values), nie `toList()`: toList przy rozmiarze 1 robi iterator().next(),
|
||||||
|
+ // a wpis moze zniknac miedzy size() i next() -> NoSuchElementException (Goon 0.4.2,
|
||||||
|
+ // Sentry GOON-72). Konstruktor idzie przez toArray(), ktore mapa robi bezpiecznie.
|
||||||
|
+ val sessions = ArrayList(mediaSessions.values)
|
||||||
+ mediaSessions.clear()
|
+ mediaSessions.clear()
|
||||||
+ sessions.forEach { session ->
|
+ sessions.forEach { session ->
|
||||||
session.release()
|
session.release()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue