wordpress-mobile / wordpress-mobile/WordPress-iOS
[Jetpack plugin install] Stats view stuck showing "Enable Site Stats" after installing Jetpack
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 1.2k
- Avg merge
- 23h 51m
- Merged PRs (30d)
- 58
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in StatsViewController.actionButtonPressed and trace activateStatsModuleWithSuccess using the reported WordPressComRestApiError. Reproduce the Jetpack installation flow, then verify that the existing-module error leads to the Stats view loading instead of returning to “Looking for stats?”.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100