-
Notifications
You must be signed in to change notification settings - Fork 112
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
[Resilience] Customize error banner message when data can't be loaded due to parsing errors #10260
Conversation
You can test the changes from this Pull Request by:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It was the first time for me to modify the response using a breakpoint in Charles Proxy, took me some time to figure out why I couldn't edit the response (had to tap Cancel
instead of Execute
while online tutorials said to tap Execute
) 😓
Non-blocking: if it's easy to identify the offline error, maybe we can show a different message about it to indicate the device is currently offline.
|
||
// When | ||
viewModel.synchronizeReviews(pageNumber: 1, pageSize: 25, onCompletion: nil) | ||
|
||
// Then | ||
XCTAssertTrue(viewModel.hasErrorLoadingData) | ||
XCTAssertNotNil(viewModel.dataLoadingError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe it can also assert that the error is SampleError.first
Generated by 🚫 dangerJS |
Part of #10162
Description
This is a followup to #10252. In that PR, we improved the message on the Orders list error banner when there is a parsing error while loading data. This PR makes the same change for Products, Reviews, and the empty state screen.
If the error was a parsing (decoding) error, the banner message now mentions possible plugin conflicts.
Changes
showTopBannerView(for:)
.Note: The banner isn't updated yet on the My store screen (see the issue in #10259).
Testing instructions
You can test using a tool like Charles Proxy or Proxyman to intercept and modify the API response:
/wc/v3/products
endpoint.Repeat the steps with a breakpoint for requests to the
/wc/v3/products/reviews
endpoint, opening Menu > Reviews in the app.Screenshots
RELEASE-NOTES.txt
if necessary.