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

Prevent crashes on Wear when offline / server no longer available #2825

Merged
merged 1 commit into from Aug 30, 2022

Conversation

jpelgrom
Copy link
Member

Summary

While helping a user with problems in their Wear app, it became clear that the app provides almost no options to do anything and is easy to crash if the server can't be reached. This PR aims to address that.

  • Catch exceptions thrown when executing calls to change an entity state instead of crashing the app. No visual feedback is provided as the app always shows the live state, so the lack of a visible change should be enough to indicate failure.
  • Allow opening Settings when loading entities failed to make it possible to sign out.
  • When logging out from the app fails during revokeSession, instead of crashing catch it and continue with logout in the app as the server might no longer be available. This better matches the options available when the main app can't reach the server.

Without the last two changes, if the server is no longer available the user might be 'locked in' with no way to change the server aside from resetting the entire app.

Screenshots

The main screen now shows the settings button below the 'Error loading entities' message:
The main screen now shows the settings button below the 'Error loading entities' message

Link to pull request in Documentation repository

n/a

Any other notes

 - Catch exceptions thrown when executing calls to change an entity state instead of crashing the app
 - When revoking a session fails continue with logout as the server might no longer be available and the user otherwise might be 'locked in' with no way to change the server
@JBassett JBassett merged commit 3908a07 into home-assistant:master Aug 30, 2022
@jpelgrom jpelgrom deleted the fix-wear-offline-crashes branch August 30, 2022 05:06
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.

None yet

3 participants