WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

[Jetpack plugin install] Stats view stuck showing "Enable Site Stats" after installing Jetpack

Open staskus opened this issue 2 years ago • 0 comments

Stats view stuck showing "Enable Site Stats" after installing Jetpack plugin in the Stats view

Expected behavior

After clicking "Enable Site Stats" the Stats appear.

Technical Details

In StatsViewController actionButtonPressed method activateStatsModuleWithSuccess is called when "Enable Site Stats" button is pressed. However, failure happens with an error:

WordPressKit.WordPressComRestApiError Code=7 "The Jetpack Module is already activated." UserInfo={WordPressComRestApiErrorMessageKey=The Jetpack Module is already activated., WordPressComRestApiErrorCodeKey=activation_error, NSLocalizedDescription=The Jetpack Module is already activated.}

as one of the potential solution we could handle this particular error and load the stats.

Steps to reproduce the behavior

  1. Log in to the self-hosted site which doesn't have Jetpack installed
  2. Go to "Stats"
  3. Select "Install"
  4. Finish the installation flow and log in to WP.com
  5. Stats screen shows "Looking for stats?" message
  6. Click "Enable Site Stats"
  7. View refreshes and "Looking for stats?" appears again

Workaround: Close & Reopen stats

Tested on iPad Pro 12.9, iOS 15.5, WPiOS 20.5

https://user-images.githubusercontent.com/4062343/187679710-4811c2d2-3764-474b-9346-d4ad763fe416.mp4

staskus avatar Aug 31 '22 12:08 staskus