Skip to content

[7.1 Backport] -- Media: Add timeout and size guardrails to client-side GIF to video conversion - #80420

Merged
t-hamano merged 2 commits into
wp/7.1from
backport/80379-to-wp-7.1
Jul 20, 2026
Merged

[7.1 Backport] -- Media: Add timeout and size guardrails to client-side GIF to video conversion#80420
t-hamano merged 2 commits into
wp/7.1from
backport/80379-to-wp-7.1

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Jul 17, 2026

Copy link
Copy Markdown
Member

Backports #80379 (merged as 8852382) to the wp/7.1 branch. The automated cherry-pick failed with conflicts; see #80379 (comment).

Stacked on #80421 (the #79955 backport), matching the order the originals merged in trunk. Once #80421 merges into wp/7.1, this PR's diff reduces to just the #80379 changes.

Why

Fixes #80376 for WordPress 7.1: adds a conversion timeout and a pixel budget (width x height x frames) to client-side GIF-to-video conversion so oversized GIFs skip conversion instead of wedging the upload queue, and makes cancelItem's worker cancellation calls best-effort so a crashed or busy worker cannot block cancellation.

Conflict resolution

The automated cherry-pick's conflicts were caused by wp/7.1 missing #79955, which on trunk changed the same cancelItem lines. With #80421 applied first, the #80379 cherry-pick applies with no conflicts at all.

Verification

Every source file at the stack tip is byte-identical to current trunk (git diff origin/trunk is empty across packages/upload-media/src, packages/video-conversion/src, packages/worker-threads/src, and the e2e spec), and the changed-file list matches the original PR exactly. All upload-media, video-conversion, and worker-threads unit tests pass (410 tests).

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Size Change: +535 B (+0.01%)

Total Size: 7.73 MB

📦 View Changed
Filename Size Change
build/modules/video-conversion/worker.min.js 83.7 kB +223 B (+0.27%)
build/scripts/upload-media/index.min.js 15.5 kB +312 B (+2.05%)

compressed-size-action

@adamsilverstein adamsilverstein changed the title Media: Add timeout and size guardrails to client-side GIF to video conversion (wp/7.1 backport) [7.1 Backport] -- Media: Add timeout and size guardrails to client-side GIF to video conversion Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Flaky tests detected in 6368d85.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29651846081
📝 Reported issues:

@adamsilverstein adamsilverstein added the [Feature] Client Side Media Media processing in the browser with WASM label Jul 17, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs Review in WordPress 7.1 Editor Tasks Jul 17, 2026
@t-hamano t-hamano added the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Jul 18, 2026
@t-hamano

Copy link
Copy Markdown
Contributor

In my understanding, it seems easier to backport #80421 first rather than backporting this PR. See #80421 (comment)

@adamsilverstein
adamsilverstein force-pushed the backport/80379-to-wp-7.1 branch from b011d4d to 6368d85 Compare July 18, 2026 16:22
@adamsilverstein

Copy link
Copy Markdown
Member Author

In my understanding, it seems easier to backport #80421 first rather than backporting this PR. See #80421 (comment)

Good point! Done.

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to land after the other PR to me!

Comment thread packages/upload-media/CHANGELOG.md Outdated
Comment on lines +14 to +16
### Bug Fixes

- `cancelItem` no longer awaits the best-effort worker cancellation calls. A busy vips worker is synchronously blocked inside a wasm call and cannot answer the cancellation RPC until every operation already queued in the worker finishes, which for a large animated GIF left cancelled items stuck in the queue - and the parent attachment unfinalized - for minutes ([#80376](https://github.com/WordPress/gutenberg/issues/80376)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is a rebase or merge nit, but this adds an extra ### Bug Fixes heading (we already have one below). Is it worth doing a pass to make sure these are in the right order / no duplicate headings, in case that helps subsequent backports?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02c163e - merged the duplicate heading and normalized the Unreleased section to match trunk byte-for-byte, which should keep subsequent backports conflict-free. Also verified every other file in this PR carries exactly the same changes as #80379 on trunk.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

…nversion (#80379)

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
@adamsilverstein
adamsilverstein force-pushed the backport/80379-to-wp-7.1 branch from 6368d85 to 0a0240d Compare July 20, 2026 03:57
@adamsilverstein

Copy link
Copy Markdown
Member Author

Rebased onto wp/7.1 now that #80421 is merged - the duplicate commit dropped cleanly and the PR is mergeable again. Ready to land once CI is green.

@andrewserong

Copy link
Copy Markdown
Contributor

Ready to land once CI is green.

Looking good!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to merge this PR, but it's a hassle to find out which PR actually made the change, as the recent entries in this changelog file link to issues rather than PRs. It would probably be better to fix this on both the trunk and wp/7.1 branches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-hamano so the changelog entries should point to the PRs merged instead of the issue? I can go back and fix all of the client side media ones if thats helpful I likely did them all the same way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the changelog entries should point to the PRs merged instead of the issue?

There are no strict rules, but I believe changelog entries have been that way in the past. However, it's not urgent, so I think it's fine to correct it later 👍

@t-hamano
t-hamano merged commit 39bb970 into wp/7.1 Jul 20, 2026
46 of 50 checks passed
@t-hamano
t-hamano deleted the backport/80379-to-wp-7.1 branch July 20, 2026 07:57
@github-project-automation github-project-automation Bot moved this from 🔎 Needs Review to ✅ Done in WordPress 7.1 Editor Tasks Jul 20, 2026
t-hamano added a commit that referenced this pull request Jul 21, 2026
…nversion (#80420)

* Media: Add timeout and size guardrails to client-side GIF to video conversion (#80379)

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

* Merge duplicate Bug Fixes changelog headings to match trunk

---------

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
@t-hamano

Copy link
Copy Markdown
Contributor

I just cherry-picked this PR to the release/23.6 branch to get it included in the next release: e0a3943

@t-hamano t-hamano added this to the Gutenberg 23.6 milestone Jul 21, 2026
@t-hamano t-hamano removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Jul 21, 2026
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Jul 22, 2026
This updates the pinned commit hash of the Gutenberg repository from `e73c3c481db0650183f092af157f6e42efe9ee2d` to `4997026b75c922d8a6f77a03d72ed7cad04c7073`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@e73c3c4...4997026

- Notes: Replace blur-deselect bookkeeping with useFocusOutside (WordPress/gutenberg#80222)
- Playlist: Update @SInCE tags to 7.1.0 (WordPress/gutenberg#80317)
- fix playlist block Dimensions Design (WordPress/gutenberg#80312)
- UI: Backport compat overlay fixes to WordPress 7.1 (WordPress/gutenberg#80322)
- Editor: allow selecting which block styles to apply globally (WordPress/gutenberg#79839)
- Global Styles: Reject non-string custom CSS in the REST controller (WordPress/gutenberg#80338)
- Open inspector sidebar when toggling responsive editing (WordPress/gutenberg#80307)
- Client Side Media: Honor image_strip_meta and image_max_bit_depth on the client upload path (WordPress/gutenberg#80218)
- Hide block style variations when state is enabled in global styles (WordPress/gutenberg#80341)
- Media REST API: Fix sideload and finalize for EXIF rotated images (WordPress/gutenberg#80295)
- Fix upload snackbar stuck in uploading state on server-side uploads (WordPress/gutenberg#80345)
- Try fixing responsive layout in Nav block (WordPress/gutenberg#80305)
- Responsive styles: Use viewport dropdown to control states for in-editor global styles sidebar (WordPress/gutenberg#80339)
- RichTextControl: Replace DOM focus tracking with a single React-tree focus boundary (WordPress/gutenberg#80324)
- Notes: Finish WPDS treatment for mention chips (WordPress/gutenberg#80300)
- Notes: Add placeholders to the RichText fields (WordPress/gutenberg#80296)
- Fix upload hang when converting long animated GIFs: decode only the first frame for still outputs (WordPress/gutenberg#80260) (WordPress/gutenberg#80342)
- Device preview dropdown: use active color for device icon when responsive styles are active (WordPress/gutenberg#80346)
- Fix default aspect ratio for lazy loaded Featured image (WordPress/gutenberg#80386)
- Vips/upload-media: consolidate optional params into options objects (WordPress/gutenberg#80330)
- Autocompleters: Don't pre-encode mention search terms (WordPress/gutenberg#80377)
- Animated GIF uploads: generate sub-sizes from the first frame, matching core (WordPress/gutenberg#80268)
- Custom CSS: Fix cascade order against block style variations (WordPress/gutenberg#80340)
- Rich Text: Restore the selection when focus returns to the editable (WordPress/gutenberg#80396)
- Notes: Arm the mention kses allowance on REST note creation (WordPress/gutenberg#80221)
- Fix upload snackbar double-counting a single HEIC upload in Safari (WordPress/gutenberg#80436)
- ContentEditableControl: fix invalid label association with contenteditable div (WordPress/gutenberg#80441)
- Editor: Disable canvas resizing while zoomed out (WordPress/gutenberg#80391)
- Fix Color Picker Cursor Shaking Issue (WordPress/gutenberg#80205) (WordPress/gutenberg#80435)
- Misc fixes for WordPress-Develop 7.0 merges (WordPress/gutenberg#80444)
- Style Book: Restore live global styles updates on the styles route (WordPress/gutenberg#80459)
- Worker threads: reject pending RPC calls on worker failure or termination (WordPress/gutenberg#79955) (WordPress/gutenberg#80421)
- Media: Add timeout and size guardrails to client-side GIF to video conversion (WordPress/gutenberg#80420)
- Post Content: Use the default block appender for empty content (WordPress/gutenberg#80026)
- Block Supports: Handle nested array block gap values properly (WordPress/gutenberg#80464)
- Editor: Restore fixed device preview height for mobile and tablet (WordPress/gutenberg#80466)
- Block Editor: Guard against non-string spacing preset values (WordPress/gutenberg#80467)
- Writing flow: fully select the ancestor when a text selection crosses a nesting boundary (WordPress/gutenberg#80462)
- Block Editor: Reflect inherited Global Styles values in block inspector controls (WordPress/gutenberg#80481)
- Autocomplete: Reference the suggestions list with `aria-controls` and `aria-haspopup` (WordPress/gutenberg#80403) (WordPress/gutenberg#80499)
- Media: Remove the redundant __heicUploadSupport flag (WordPress/gutenberg#80486)
- State control - avoid tertiary variant on toggle to match style of other dropdown toggles (WordPress/gutenberg#80505)
- Icons: Store the sanitized SVG content when registering an icon (WordPress/gutenberg#80508)
- Fix `useHomeEnd` on tabs in mac testing (WordPress/gutenberg#80374)
- Playlist: Fix playback of tracks served without CORS headers (WordPress/gutenberg#80533)
- Redirect editing events to extension handlers under editableRoot (WordPress/gutenberg#80287)
- Writing flow: fully select the items when a selection extends down into a nested item (WordPress/gutenberg#80492)
- Global Styles panels: fix wrong preset committed and shown when two color presets share a hex (WordPress/gutenberg#80497)
- Replaces the `title` attributes used by revision inline diff annotations with `aria-describedby` (WordPress/gutenberg#80440)
- Notes: Remove "Add note" from the inline styles dropdown (WordPress/gutenberg#80531)
- Global Styles: Resolve per-level heading element styles in block inspector controls (WordPress/gutenberg#80495)
- Notes: Render @ mentions as span chips and narrow the kses class allowance (WordPress/gutenberg#80528)
- Revisions: Specify block level diff status via aria-label (WordPress/gutenberg#77779)
- Backport from Core: improve icon name unit tests (WordPress/gutenberg#80552)
- Device type preview: fix collapsing to content height (WordPress/gutenberg#80553)
- Wrap notices in ThemeProvider with 0 corner radius (WordPress/gutenberg#80557)
- Global Styles: Limit the inherited value treatment to the Gutenberg plugin (WordPress/gutenberg#80555)
- Fix crashes when manipulating locked blocks (WordPress/gutenberg#80509)
- Notes: align floating threads with their inline marker (WordPress/gutenberg#79877)

Props wildworks.
See #65529.

git-svn-id: https://develop.svn.wordpress.org/trunk@62824 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 22, 2026
This updates the pinned commit hash of the Gutenberg repository from `e73c3c481db0650183f092af157f6e42efe9ee2d` to `4997026b75c922d8a6f77a03d72ed7cad04c7073`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@e73c3c4...4997026

- Notes: Replace blur-deselect bookkeeping with useFocusOutside (WordPress/gutenberg#80222)
- Playlist: Update @SInCE tags to 7.1.0 (WordPress/gutenberg#80317)
- fix playlist block Dimensions Design (WordPress/gutenberg#80312)
- UI: Backport compat overlay fixes to WordPress 7.1 (WordPress/gutenberg#80322)
- Editor: allow selecting which block styles to apply globally (WordPress/gutenberg#79839)
- Global Styles: Reject non-string custom CSS in the REST controller (WordPress/gutenberg#80338)
- Open inspector sidebar when toggling responsive editing (WordPress/gutenberg#80307)
- Client Side Media: Honor image_strip_meta and image_max_bit_depth on the client upload path (WordPress/gutenberg#80218)
- Hide block style variations when state is enabled in global styles (WordPress/gutenberg#80341)
- Media REST API: Fix sideload and finalize for EXIF rotated images (WordPress/gutenberg#80295)
- Fix upload snackbar stuck in uploading state on server-side uploads (WordPress/gutenberg#80345)
- Try fixing responsive layout in Nav block (WordPress/gutenberg#80305)
- Responsive styles: Use viewport dropdown to control states for in-editor global styles sidebar (WordPress/gutenberg#80339)
- RichTextControl: Replace DOM focus tracking with a single React-tree focus boundary (WordPress/gutenberg#80324)
- Notes: Finish WPDS treatment for mention chips (WordPress/gutenberg#80300)
- Notes: Add placeholders to the RichText fields (WordPress/gutenberg#80296)
- Fix upload hang when converting long animated GIFs: decode only the first frame for still outputs (WordPress/gutenberg#80260) (WordPress/gutenberg#80342)
- Device preview dropdown: use active color for device icon when responsive styles are active (WordPress/gutenberg#80346)
- Fix default aspect ratio for lazy loaded Featured image (WordPress/gutenberg#80386)
- Vips/upload-media: consolidate optional params into options objects (WordPress/gutenberg#80330)
- Autocompleters: Don't pre-encode mention search terms (WordPress/gutenberg#80377)
- Animated GIF uploads: generate sub-sizes from the first frame, matching core (WordPress/gutenberg#80268)
- Custom CSS: Fix cascade order against block style variations (WordPress/gutenberg#80340)
- Rich Text: Restore the selection when focus returns to the editable (WordPress/gutenberg#80396)
- Notes: Arm the mention kses allowance on REST note creation (WordPress/gutenberg#80221)
- Fix upload snackbar double-counting a single HEIC upload in Safari (WordPress/gutenberg#80436)
- ContentEditableControl: fix invalid label association with contenteditable div (WordPress/gutenberg#80441)
- Editor: Disable canvas resizing while zoomed out (WordPress/gutenberg#80391)
- Fix Color Picker Cursor Shaking Issue (WordPress/gutenberg#80205) (WordPress/gutenberg#80435)
- Misc fixes for WordPress-Develop 7.0 merges (WordPress/gutenberg#80444)
- Style Book: Restore live global styles updates on the styles route (WordPress/gutenberg#80459)
- Worker threads: reject pending RPC calls on worker failure or termination (WordPress/gutenberg#79955) (WordPress/gutenberg#80421)
- Media: Add timeout and size guardrails to client-side GIF to video conversion (WordPress/gutenberg#80420)
- Post Content: Use the default block appender for empty content (WordPress/gutenberg#80026)
- Block Supports: Handle nested array block gap values properly (WordPress/gutenberg#80464)
- Editor: Restore fixed device preview height for mobile and tablet (WordPress/gutenberg#80466)
- Block Editor: Guard against non-string spacing preset values (WordPress/gutenberg#80467)
- Writing flow: fully select the ancestor when a text selection crosses a nesting boundary (WordPress/gutenberg#80462)
- Block Editor: Reflect inherited Global Styles values in block inspector controls (WordPress/gutenberg#80481)
- Autocomplete: Reference the suggestions list with `aria-controls` and `aria-haspopup` (WordPress/gutenberg#80403) (WordPress/gutenberg#80499)
- Media: Remove the redundant __heicUploadSupport flag (WordPress/gutenberg#80486)
- State control - avoid tertiary variant on toggle to match style of other dropdown toggles (WordPress/gutenberg#80505)
- Icons: Store the sanitized SVG content when registering an icon (WordPress/gutenberg#80508)
- Fix `useHomeEnd` on tabs in mac testing (WordPress/gutenberg#80374)
- Playlist: Fix playback of tracks served without CORS headers (WordPress/gutenberg#80533)
- Redirect editing events to extension handlers under editableRoot (WordPress/gutenberg#80287)
- Writing flow: fully select the items when a selection extends down into a nested item (WordPress/gutenberg#80492)
- Global Styles panels: fix wrong preset committed and shown when two color presets share a hex (WordPress/gutenberg#80497)
- Replaces the `title` attributes used by revision inline diff annotations with `aria-describedby` (WordPress/gutenberg#80440)
- Notes: Remove "Add note" from the inline styles dropdown (WordPress/gutenberg#80531)
- Global Styles: Resolve per-level heading element styles in block inspector controls (WordPress/gutenberg#80495)
- Notes: Render @ mentions as span chips and narrow the kses class allowance (WordPress/gutenberg#80528)
- Revisions: Specify block level diff status via aria-label (WordPress/gutenberg#77779)
- Backport from Core: improve icon name unit tests (WordPress/gutenberg#80552)
- Device type preview: fix collapsing to content height (WordPress/gutenberg#80553)
- Wrap notices in ThemeProvider with 0 corner radius (WordPress/gutenberg#80557)
- Global Styles: Limit the inherited value treatment to the Gutenberg plugin (WordPress/gutenberg#80555)
- Fix crashes when manipulating locked blocks (WordPress/gutenberg#80509)
- Notes: align floating threads with their inline marker (WordPress/gutenberg#79877)

Props wildworks.
See #65529.
Built from https://develop.svn.wordpress.org/trunk@62824


git-svn-id: http://core.svn.wordpress.org/trunk@62104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Client Side Media Media processing in the browser with WASM [Type] Bug An existing feature does not function as intended

Projects

Development

Successfully merging this pull request may close these issues.

3 participants