File tree Expand file tree Collapse file tree
livekit-android-sdk/src/main/java/io/livekit/android/room Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " client-sdk-android " : patch
3+ ---
4+
5+ Ensure child jobs are cleaned up on ICE reconnect timeout
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2025 LiveKit, Inc.
2+ * Copyright 2023-2026 LiveKit, Inc.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -620,20 +620,20 @@ internal constructor(
620620 break
621621 }
622622
623- // wait until publisher ICE connected
624- var publisherWaitJob: Job ? = null
625- if (hasPublished) {
626- publisherWaitJob = launch {
627- publisherObserver.waitUntilConnected()
623+ withTimeoutOrNull(MAX_ICE_CONNECT_TIMEOUT_MS .toLong()) {
624+ // wait until publisher ICE connected
625+ var publisherWaitJob: Job ? = null
626+ if (hasPublished) {
627+ publisherWaitJob = launch {
628+ publisherObserver.waitUntilConnected()
629+ }
628630 }
629- }
630631
631- // wait until subscriber ICE connected
632- val subscriberWaitJob = launch {
633- subscriberObserver.waitUntilConnected()
634- }
632+ // wait until subscriber ICE connected
633+ val subscriberWaitJob = launch {
634+ subscriberObserver.waitUntilConnected()
635+ }
635636
636- withTimeoutOrNull(MAX_ICE_CONNECT_TIMEOUT_MS .toLong()) {
637637 listOfNotNull(publisherWaitJob, subscriberWaitJob)
638638 .joinAll()
639639 }
You can’t perform that action at this time.
0 commit comments