Improve Wear OS error handling on home, check websocket connection state #2261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the Wear OS' app error handling on the home screen, by showing errors and/or redirecting to onboarding instead of crashing the app on errors. More specifically:
For more on specific changes, view the comments in individual commits.
Screenshots
General error:
If the user has favorites, the error will be shown below the favorites (in place of the loading text/chip) and favorites are still accessible:
No supported domains message if loading completed but the lists are still emtpy:
Settings remains accessible in all cases to allow changing tile settings, logging out, etc.
If you need to login again because authentication failed, the app will immediately send you to onboarding like the phone app.
Link to pull request in Documentation repository
I don't think this is needed, "Check the documentation" in the no supported domains error refers to the general documentation for Wear OS which lists supported domains.
Any other notes
If you're going to test this, be aware that because the websocket doesn't immediately throw an error if something fails once the connection is established, the app might send multiple requests before stopping which can trigger maximum number of failed login -> IP ban protections.