woocommerce-android icon indicating copy to clipboard operation
woocommerce-android copied to clipboard

Log user out when Jetpack is disconnected and all API requests start failing

Open JorgeMucientes opened this issue 9 months ago • 1 comments

Describe the bug If the user disconnect their site from Jetpack while being logged into the app, the app will start showing errors and fail to fetch any data from the API until the user kills the app and restarts it.

To Reproduce Steps to reproduce the behavior:

  1. Log into a Jetpack connected site in the mobile app
  2. From wc-admin web, disconnect Jetpack
  3. Go back to the app and try to fetch any data (stats, orders, products, etc). See how everything fails.
  4. Verify that you need to kill the app and restart it to get logged out from the site.

Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/user-attachments/assets/51b69b56-1d5f-4f19-868d-db9ed8c3e8e0

Proposed solution

When we start recieving API errors related to auth issues due to Jetpack being disconnected, we should trigger the logic that checks the current site's connection and if Jetpack disconnected, take the user to the site picker or logged them out, as we do when the app is restarted.

JorgeMucientes avatar Jan 14 '25 14:01 JorgeMucientes