Automattic / Automattic/jetpack

The scan state transient can be incorrect for up to 30 minutes.

Open
#20,434 1 comment 0 reactions 0 assignees View on GitHub
[Plugin] Jetpack [Pri] Low [Status] Auto-allocated Admin Page Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

The scan state is stored in a transient, `jetpack_scan_state`. The transient can hold an incorrect state for up to 30 minutes after purchase.

#### Steps to reproduce the issue

1. Install, activate, and connect Jetpack. Do not add any products or bundles to the site.
2. Remove the `jetpack_scan_state` transient: `wp transient delete jetpack_scan_state`
3. Navigate to a Jetpack admin page. Check the `jetpack_scan_state` transient: `wp transient get jetpack_scan_state`. The state should be 'unavailable'.
4. Add the Scan product to the site.
5. Refresh a wp-admin page. Notice that the side menu does not show scan.
6. Check the value of the transient and notice that it's still unavailable.
7. Repeat steps 5 and 6 occasionally for 30 minutes. Notice that the Scan menu item is still missing and the transient value is unchanged.
8. After ~30 minutes, the transient will expire. When you refresh a page, the transient should update and the Scan menu item should be displayed.

#### What I expected
The scan menu item should be displayed and the transient value should be correct shortly after purchase.

Contributor guide

Open the contributing guide

Research direction

The issue names no source file; begin with the `jetpack_scan_state` transient and reproduce the behavior using `wp transient delete/get` while visiting a wp-admin page. Trace where the Scan product purchase is reflected in the transient and admin side menu, then verify the transient changes shortly after purchase and the Scan menu appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.