-
Notifications
You must be signed in to change notification settings - Fork 133
[Shipping labels] Improve the error message for empty shipping rates list #14433
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
base: trunk
Are you sure you want to change the base?
Conversation
New string resources are added to inform users when no shipping services are found for their selected package and shipment weight, including a specific message for shipments containing hazardous materials.
A new exception class `NoAvailableRatesException` is added to handle cases where no shipping rates are available. This exception includes a string resource ID for a user-friendly message.
The `ShippingRatesSection` composable is updated to display error messages from the `ShippingRatesState.Error` state, rather than a generic, hardcoded string. This allows for more specific error messages to be shown to the user.
The `ErrorMessageWithButton` composable now has a 16.dp padding.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
val errorMessage = if (exception is NoAvailableRatesException) { | ||
exception.messageResId | ||
} else { | ||
trackShippingRatesLoading(isSuccess = false, error = exception.message) |
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.
trackShippingRatesLoading()
was being triggered when the endpoint returned empty rates, but an empty rates case is not actually an error. So, I removed the tracking for it.
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.
I'm not sure about this. I agree empty rates is not an error but we might want to track it anyway. We could add something like:
analyticsTracker.track(AnalyticsEvent.WCS_RATE_SELECTION_STEP, mapOf(KEY_STATE to "loading_success_empty_rates"))
Wdyt?
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.
I want to include @itsmeichigo in the discussion. Do you track empty rates on iOS?
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #14433 +/- ##
=========================================
Coverage 38.01% 38.01%
Complexity 9229 9229
=========================================
Files 1993 1993
Lines 112506 112514 +8
Branches 14843 14845 +2
=========================================
+ Hits 42771 42776 +5
- Misses 65839 65840 +1
- Partials 3896 3898 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Hey @irfano Changes work well and code looks good. I just left a minor suggestion but nothing blocking. Let me know your thought :)
val errorMessage = if (exception is NoAvailableRatesException) { | ||
exception.messageResId | ||
} else { | ||
trackShippingRatesLoading(isSuccess = false, error = exception.message) |
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.
I'm not sure about this. I agree empty rates is not an error but we might want to track it anyway. We could add something like:
analyticsTracker.track(AnalyticsEvent.WCS_RATE_SELECTION_STEP, mapOf(KEY_STATE to "loading_success_empty_rates"))
Wdyt?
Description
This adds a specific error message for the case when no shipping rates are available.
The error message
When hazmat is not selected
We couldn't find a shipping service for the combination of the selected package and the total shipment weight. Please adjust your input and try again.
When hazmat is selected
We couldn't find a shipping service for the combination of the selected HAZMAT category, the selected package and the total shipment weight. Please adjust your input and try again.
Steps to reproduce
The tests that have been performed
Steps above
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.