Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make WifiHelper available in getServer fallback #4670

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

jpelgrom
Copy link
Member

Summary

If getServer is unable to get the server from cache it is directly read from the database. When that happens and returns a result, make sure the WifiHelper is available like when cached.

Fixes the following crash observed in the Play Console:

Exception kotlin.UninitializedPropertyAccessException:
  at io.homeassistant.companion.android.database.server.ServerConnectionInfo.getWifiHelper (ServerConnectionInfo.kt:34)
  at io.homeassistant.companion.android.database.server.ServerConnectionInfo.isInternal (ServerConnectionInfo.kt:97)
  at io.homeassistant.companion.android.database.server.ServerConnectionInfo.getUrl (ServerConnectionInfo.kt:80)
  at io.homeassistant.companion.android.database.server.ServerConnectionInfo.getUrl$default (ServerConnectionInfo.kt:75)
  at io.homeassistant.companion.android.common.data.websocket.impl.WebSocketRepositoryImpl.connect (WebSocketRepositoryImpl.kt:576)
  at io.homeassistant.companion.android.common.data.websocket.impl.WebSocketRepositoryImpl.sendMessage (WebSocketRepositoryImpl.kt:640)
  at io.homeassistant.companion.android.common.data.websocket.impl.WebSocketRepositoryImpl.subscribeTo (WebSocketRepositoryImpl.kt:422)
  at io.homeassistant.companion.android.common.data.websocket.impl.WebSocketRepositoryImpl.access$subscribeTo (WebSocketRepositoryImpl.kt:88)
  at io.homeassistant.companion.android.common.data.websocket.impl.WebSocketRepositoryImpl$subscribeTo$1.invokeSuspend
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

 - If getServer is unable to get the server from cache it is directly read from the database. When that happens and returns a result, make sure the WifiHelper is available like when cached.
Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

thanks for the fix! 🙏

@dshokouhi dshokouhi merged commit f6fd348 into home-assistant:master Sep 26, 2024
4 checks passed
@jpelgrom jpelgrom deleted the fallback-wifihelper branch September 26, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants