Skip to content
Open
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/five-games-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"client-sdk-android": patch
---

Properly reset network callback manager after disconnect
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ constructor(
return@runBlocking
}
networkCallbackManager.unregisterCallback()
hasLostConnectivity = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I had this on my list to look at.
Minor concern: consider adding @Volatile in the declaration to make it:

@Volatile
private var hasLostConnectivity: Boolean = false

Network callbacks run on the system's ConnectivityManager thread, while room operations run on coroutine dispatchers. While the current code is functionally safe (unregister happens before reset, so no concurrent access), adding @Volatile would be a good defensive move, imo.


state = State.DISCONNECTED
cleanupRoom()
Expand Down