Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/webrtc-init-latch-after-success.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"client-sdk-android": patch
---

Fix: only latch WebRTC initialization after PeerConnectionFactory.initialize succeeds, so a failed native library load stays retryable and surfaces as a catchable exception instead of poisoning the process and crashing on the next LiveKit.create() call.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ internal object RTCModule {
if (!hasInitializedWebrtc) {
executeBlockingOnRTCThread(LibWebrtcInitializationThreadToken) {
if (!hasInitializedWebrtc) {
hasInitializedWebrtc = true
PeerConnectionFactory.initialize(
PeerConnectionFactory.InitializationOptions
.builder(appContext)
Expand All @@ -128,6 +127,12 @@ internal object RTCModule {
)
.createInitializationOptions(),
)
// Only latch after initialize succeeds. If it throws (e.g. the native
// library fails to load), latching beforehand would permanently skip
// initialization for the process, and the next native call would crash
// with an uncatchable-by-catch(Exception) UnsatisfiedLinkError instead
// of a catchable failure at the call site.
hasInitializedWebrtc = true
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
}
}
}
Expand Down
Loading