wordpress-mobile / wordpress-mobile/WordPress-iOS

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

Open
#19,260 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Bug Jetpack Install
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
  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.