Skip to content

fix?(ios): Always connect socket onAppear - #1908

Open
KaylaBrady wants to merge 3 commits into
mainfrom
kb-shimmer-loading-again
Open

fix?(ios): Always connect socket onAppear#1908
KaylaBrady wants to merge 3 commits into
mainfrom
kb-shimmer-loading-again

Conversation

@KaylaBrady

Copy link
Copy Markdown
Collaborator

Summary

Ticket: another pass at "infinite shimmer loading"

What is this PR for?

This attempts to fix the infinite shimmer issue by considering if there is some condition under which we don't call socket.attach when the app is launched.

Currently, we only call socket.attach in an onChange(of: scenePhase). The swift docs say: "How you interpret the value depends on where it’s read from. If you read the phase from inside a View instance, you obtain a value that reflects the phase of the scene that contains the view." In my local testing, the ContentView always went from inactive => active on launch which would trigger the socket to attach. The inner NearbyView always started out as active. What if there are some conditions under which ContentView always starts out as active?

We previously called socket.attach in both the onChange and onAppear, but that was leading to some race conditions that caused crashes. That behavior has since changed and should be fixed in SwiftPhoenixClient.

This also adds information about socket connection to the debug view so that if we continue to have reports of this issue we can see the socket status.

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

What testing have you done?

  • Added some unit tests
  • Ran locally to see DebugView looks as expected
    imageimage

@KaylaBrady
KaylaBrady requested a review from a team as a code owner July 31, 2026 13:33
@KaylaBrady
KaylaBrady requested a review from boringcactus July 31, 2026 13:33
@KaylaBrady
KaylaBrady force-pushed the kb-shimmer-loading-again branch from af1fecb to 83bb6ae Compare July 31, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants