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 for mismatched account case #12914

Closed irfano closed 1 week ago

irfano commented 1 week ago

(cherry picked from commit 8219ffa0b7d5a58daf2d81bc9ed201d6f7a39561)

Description

This fixes a crash on the site picker screen when the sites data is null. I couldn't reproduce the crash. But when the sites.value is null for any reason, it makes sense to hide the primary button on the site picker screen. This case may occur rarely and temporarily when the screen is initializing.

Steps to reproduce

"To reproduce the issue, you need a WordPress.com account with 0 sites. Not even a blog. Which is tricky to get through the normal flow because WP.com will create 1 blog for you as soon as you create a new account. However, if you delete that blog (and wait a few hours until the deletion is completed) you'll end up with a WP.com account with 0 sites. Using that account o log into any Jetpack connected site will result in the account mismatch screen and the app crashing. - https://github.com/woocommerce/woocommerce-android/pull/12889#issuecomment-2462908860"

Testing information

Tested normal mismatch account case.

The tests that have been performed

Tested normal mismatch account case again for this PR.

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 week ago
1 Warning
:warning: This PR is assigned to the milestone 21.0.1. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 week 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
Commitcab947359dad907129d0d8c909109a8735c734f3
Direct Downloadwoocommerce-wear-prototype-build-pr12914-cab9473.apk
wpmobilebot commented 1 week 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
Commitcab947359dad907129d0d8c909109a8735c734f3
Direct Downloadwoocommerce-prototype-build-pr12914-cab9473.apk