Skip to content

fix: Clean up channel connection logic#1845

Open
EmmaSimon wants to merge 2 commits into
mainfrom
es-loading-errors
Open

fix: Clean up channel connection logic#1845
EmmaSimon wants to merge 2 commits into
mainfrom
es-loading-errors

Conversation

@EmmaSimon

@EmmaSimon EmmaSimon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Ticket: Identify persistent shimmer loading on launch root cause

This hopefully fixes the infinite loading issues for good. It seems like it was a combination of a few factors coming together.

Ultimately, the root cause was a race condition where the channel disconnect would sometimes be called right after the connect. We were also calling disconnect unnecessarily multiple times, partly because were using DisposableEffect, which was complicating the disconnect calls.

Now, we only call a single channel detach within the channel owner and the mutex before attempting to make a new connection, and we wait for the disconnection to complete before starting the new channel attach. All the DisposableEffect blocks are also changed to basic LaunchedEffect which clear existing data if the relevant params have changed, and connect on active and disconnect on inactive. This seems to be more reliable when backgrounding and changing pages.

iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
- [ ] Add temporary machine translations, marked "Needs Review"

android
- [ ] All user-facing strings added to strings resource in alphabetical order
- [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible (ideally in shared code)

Testing

Verified the correct behavior on Android and iOS, updated existing tests to pass, and could not reproduce the infinite loading issue after these changes.

@EmmaSimon EmmaSimon added the deploy to ios dev-orange Automatically deploy this PR to iOS dev-orange label Jul 8, 2026
@EmmaSimon EmmaSimon force-pushed the es-loading-errors branch from 1ac3f61 to 2cc7f33 Compare July 8, 2026 17:16
@EmmaSimon EmmaSimon marked this pull request as ready for review July 8, 2026 17:16
@EmmaSimon EmmaSimon requested a review from a team as a code owner July 8, 2026 17:16
@EmmaSimon EmmaSimon requested a review from boringcactus July 8, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy to ios dev-orange Automatically deploy this PR to iOS dev-orange

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant