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

Issue/13370 pt ii entry points to error screen #13389

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from

Conversation

hafizrahman
Copy link
Contributor

@hafizrahman hafizrahman commented Jan 24, 2025

Closes: #13419

Description

Adds a new permanent CTA when product image uploads fail, so that user can access an error screen to see the details of the failed upload an retry. The behavior of this new CTA is as follows:

  • It will be shown as soon as the first image upload error happens
  • It will stay visible until "Add photos is tapped again" for the given product. Or when navigating back from product detail with unsaved changes and clicking "Discard" changes from the confirm exit dialog CTA.
  • Currently, when the app is killed all upload errors are cleared (because we keep them in memory). This behavior probably makes sense since killing the app will also cancel the ongoing uploads.
  • A snack bar is shown for a few seconds for every upload error that happens. We might want to get rid of this snackbar in iteration II completely. Something to discuss with Ann. But for now I think it provides better visibility for each time an upload fails.

Steps to reproduce

Before running the testing steps, enable API Faker to make upload media requests. Apply the following changes from More menu > Settings > Developer Options > API faker:

Testing information

With API faker is enabled:

  1. Open product detail
  2. Open the product images screen
  3. Tap Add photos
  4. Tap Choose from device
  5. Select a photo and let the uploads fail.
  6. See how a snackbar with the number of failed uploads is shown for a couple of seconds
  7. See the new CTA "View recent upload failures" is shown
  8. Tap on it, and enter error screen. Navigate back.
  9. Navigate back to product detail and check the new "View recent upload failures" is shown
  10. Tap on it and click retry.
  11. See how you are taken back to the previous screen while the retry happens
  12. Once it fails again, close product detail and reopen it. The "View recent upload failures" should be gone

The tests that have been performed

The above

Images/gif

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 24, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit1557aa5
Direct Downloadwoocommerce-wear-prototype-build-pr13389-1557aa5.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 24, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit1557aa5
Direct Downloadwoocommerce-prototype-build-pr13389-1557aa5.apk

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 30.76923% with 27 lines in your changes missing coverage. Please review.

Project coverage is 41.22%. Comparing base (ca38ed6) to head (1557aa5).
Report is 20 commits behind head on trunk.

Files with missing lines Patch % Lines
...droid/ui/products/images/ProductImagesViewModel.kt 9.09% 10 Missing ⚠️
...m/woocommerce/android/ui/base/UIMessageResolver.kt 0.00% 7 Missing ⚠️
.../android/ui/media/MediaUploadErrorListViewModel.kt 0.00% 4 Missing ⚠️
...ommerce/android/ui/media/MediaFileUploadHandler.kt 62.50% 1 Missing and 2 partials ⚠️
...roid/ui/products/details/ProductDetailViewModel.kt 66.66% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #13389      +/-   ##
============================================
- Coverage     41.23%   41.22%   -0.01%     
- Complexity     6548     6549       +1     
============================================
  Files          1326     1326              
  Lines         77731    77754      +23     
  Branches      10706    10713       +7     
============================================
+ Hits          32049    32057       +8     
- Misses        42836    42849      +13     
- Partials       2846     2848       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from issue/13370-retry-button-failed-uploads to trunk January 28, 2025 16:52
@JorgeMucientes JorgeMucientes self-assigned this Jan 30, 2025
@JorgeMucientes JorgeMucientes added this to the 21.7 milestone Jan 30, 2025
@JorgeMucientes JorgeMucientes marked this pull request as ready for review January 30, 2025 15:36
@JorgeMucientes
Copy link
Contributor

Hey @hafizrahman I've tweaked your implementation a bit. I'd appreciate if you could test out the changes and let me know what you think 🙏🏼

@JorgeMucientes JorgeMucientes removed the request for review from hichamboushaba January 30, 2025 15:38
@JorgeMucientes JorgeMucientes added the feature: product details Related to adding or editing products, includes product settings. label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product details Related to adding or editing products, includes product settings.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image upload error screen new access point
4 participants