Automattic / Automattic/jetpack
[VideoPress] Legacy wp:video blocks with VideoPress attributes cause persistent "Review 1 change" in Site Editor
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
## Description
When a Site Editor template contains a `wp:video` block in the legacy VideoPress format (with `guid` and `videoPressClassNames` attributes), the Site Editor persistently shows \"Review 1 change\" on every page load — even after saving. Saving clears it temporarily, but it reappears on reload indefinitely.
## Root Cause
On every Site Editor load, the Jetpack/VideoPress JavaScript runs a block transform against legacy `wp:video` blocks and calls `editEntityRecord()` on the template — flagging it as dirty. However, the resulting serialized content is **byte-for-byte identical** to what's already stored (confirmed via Network tab: PATCH payload matched server response exactly). The dirty state is created entirely client-side, with no actual change to persist.
## Steps to Reproduce
1. Open the Site Editor on a site with Jetpack/VideoPress active
2. Edit any template via the Code Editor and insert the following legacy block:
```
```
3. Save the template
4. Reload the Site Editor
**Expected:** No unsaved changes indicator — nothing changed.
**Actual:** \"Review 1 change\" appears immediately on every reload.
## Impact
This affects sites that have VideoPress videos embedded in templates using the legacy `wp:video` format (created by older versions of the plugin). Users are permanently shown a false unsaved changes prompt in the Site Editor with no way to dismiss it permanently. Confirmed on multiple customer sites.
## Suggested Fix
Before calling `editEntityRecord()` during the block transform, compare the resulting serialized template content against the currently stored value. Only dispatch the edit if the content actually differs.
Contributor guide
Research direction
Reproduce the issue in the Site Editor with the legacy wp:video block shown, then locate the Jetpack/VideoPress JavaScript block transform that calls editEntityRecord(). Compare the transformed serialized template with the stored value before dispatching the edit. Done means the saved template no longer shows “Review 1 change” after reloading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100