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

Image Recommendations - Error Handling #4828

Merged
merged 8 commits into from
Apr 30, 2024
Merged

Conversation

tonisevener
Copy link
Collaborator

Phabricator: https://phabricator.wikimedia.org/T358928

Notes

This PR adds some error handling to the image recommendations feature. In summary, it delegates out any loading error to ExploreViewController, which then displays it using WMFAlertController. It also changes out the content view of image recommendations to a new error state component.

EditSaveViewController (Edit Summary view) already had a lot of working error handling from being in the editor flow, so I left that as-is.

Test Steps

The only error state that is easy to test is a network connection. Other things you can try is to temporarily mess up the url creation methods in the data controllers, like the article summary endpoint. The server should respond with some sort of error if you're missing the summary in the url path, for example.

  1. Launch app while having a connection. Wait for suggested edits card to appear.
  2. Before tapping card, enter airplane mode to ensure your connection is dropped.
  3. Tap card.
  4. Confirm you see "No internet connection" error banner and new error state component.
  5. Leave airplane mode.
  6. Once connection returns, tap "Try again".
  7. Confirm image recommendations appear.

@tonisevener tonisevener requested review from a team and mazevedofs and removed request for a team April 29, 2024 22:33
Copy link
Collaborator

@mazevedofs mazevedofs left a comment

Choose a reason for hiding this comment

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

Looks good!

@mazevedofs mazevedofs merged commit a64416c into main Apr 30, 2024
4 checks passed
@mazevedofs mazevedofs deleted the image-recs/error-handling branch April 30, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants