woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

Fix crash on site picker for accounts without woo sites #12812

Closed irfano closed 4 weeks ago

irfano commented 1 month ago

Closes: #10553

Description

This fixes a crash that occurs when using the wrong account that does not have any Woo sites. When the mismatch screen is displayed, the primary button on the site picker screen was always visible. This PR checks existing woo sites to set the visibility of the primary button.

Steps to reproduce

  1. Open the login flow and enter a Woo site address.
  2. Enter your WP account that does not have any Woo sites.
  3. When the jetpack connection error screen is displayed, navigate back.
  4. On the site picker screen tap the "Continue" button.

Testing information

The tests that have been performed

I tested the mismatch account screen with accounts that have Woo sites and accounts without any Woo sites.

Images/gif

before after

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:

dangermattic commented 1 month ago
1 Warning
:warning: This PR is assigned to the milestone 21.0. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 month ago
📲 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
Commita96e66a8f22f85bd44c8b95c8ee32672459b0238
Direct Downloadwoocommerce-wear-prototype-build-pr12812-a96e66a.apk
wpmobilebot commented 4 weeks ago

📲 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
Commita96e66a8f22f85bd44c8b95c8ee32672459b0238
Direct Downloadwoocommerce-prototype-build-pr12812-a96e66a.apk
codecov-commenter commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 40.86%. Comparing base (e1ef2aa) to head (a96e66a). Report is 17 commits behind head on trunk.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #12812 +/- ## ========================================= Coverage 40.86% 40.86% - Complexity 5765 5770 +5 ========================================= Files 1237 1237 Lines 69857 69857 Branches 9707 9707 ========================================= + Hits 28545 28549 +4 Misses 38677 38677 + Partials 2635 2631 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sentry-io[bot] commented 2 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

irfano commented 2 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ NullPointerException com.woocommerce.android.ui.sitepicker.SitePicke... View Issue

@atorresveiga, this crash was introduced in "20.9-rc-1." I'll monitor the trend, and if it appears significant, I may target the beta branch. Just keeping you informed since you’re managing the release.