WordPress-iOS
WordPress-iOS copied to clipboard
[Jetpack plugin install] Stats view stuck showing "Enable Site Stats" after installing Jetpack
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
- Log in to the self-hosted site which doesn't have Jetpack installed
- Go to "Stats"
- Select "Install"
- Finish the installation flow and log in to WP.com
- Stats screen shows "Looking for stats?" message
- Click "Enable Site Stats"
- 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