Repository navigation
Fix v2.2.2 review findings: skip-button preview, uninstall cleanup, hover race - #2120
Open
KMchaudhary wants to merge 1 commit into
Open
KMchaudhary wants to merge 1 commit into
KMchaudhary wants to merge 1 commit into
Conversation
…over race - Video editor Settings preview now normalizes skip-button durations exactly as the front-end player does (5/10/30, default 10, always shown), so the preview no longer diverges for legacy/invalid/missing values. Exports the shared normalizeSkipButtons from configurationManager and reuses it in both the initial composition (VideoEditor) and the live sync (VideoJSPlayer). - uninstall.php now also deletes rtgodam-settings (the main player/media config) plus other persistent options that survived uninstall. - Hover preview: skip the settled play() promise's mute/teardown handlers once a click has committed real playback, so a late autoplay rejection no longer pauses and resets the real video. Adds regression tests.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The hover race remains reproducible when playback is committed through Video.js controls instead of the video element.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Aligns editor skip-button previews with front-end behavior, expands uninstall cleanup, and addresses hover-preview promise races.
Changes:
- Reuses skip-duration normalization in editor previews.
- Deletes additional plugin options during uninstall.
- Guards hover-preview promise settlement and adds regression tests.
File summaries
| File | Description |
|---|---|
uninstall.php |
Expands uninstall option cleanup. |
pages/video-editor/VideoJSPlayer.js |
Normalizes live skip-button updates. |
pages/video-editor/VideoEditor.js |
Normalizes initial preview controls. |
assets/src/js/godam-player/managers/configurationManager.js |
Exports skip normalization utilities. |
assets/src/js/godam-player/managers/hoverManager.js |
Adds promise-settlement race guards. |
assets/src/js/godam-player/managers/hoverManager.test.js |
Tests hover-preview settlement behavior. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+441
to
+442
| if ( this.isVideoClicked ) { | ||
| return; |
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
missing_composer_json_file | The "/vendor" directory using composer exists, but "composer.json" file is missing. |
📁 readme.txt (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 assets/build/blocks/godam-gallery-v2/render.php (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
15 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
23 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/09/14/hello-world/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/09/14/hello-world/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the Copilot review findings on the v2.2.2 sync PR (#2118). Each was verified against the code before fixing; one flagged item (
_requery(true)inmedia-grid.js) was a false positive and is left unchanged (see note below).Fixes
1. Skip-button preview now matches the front-end player (findings 3 & 4)
The front-end player normalizes skip-button durations to 5/10/30s (falling back to 10) and always renders the buttons (
normalizeSkipButtonsinconfigurationManager.js). The Video Editor's Settings preview instead treated any non-zero value as valid and hid the buttons at0/missing — so a legacy/invalid value like7or20, or a missing value, produced a preview that didn't match what the front end renders.normalizeSkipButtons(and its constants) fromconfigurationManager.jsas the single source of truth.VideoEditor.jsseedspreviewControlBar.skipButtonsthrough it.VideoJSPlayer.jsruns the live-sync duration through it too.2.
uninstall.phpleaves persistent options behind (finding 5)rtgodam-settings— the main player/media configuration — was never deleted on uninstall, so delete → reinstall kept stale config. Added it plus other persistent options that were also missed (rtgodam-offer-banner,rtgodam-failed-transcoding-attachments,rtgodam_new_attachment,rtgodam_plugin_activation_time,rtgodam_video_metadata_migration_completed).3. Hover-preview teardown race (finding 1)
If autoplay was refused (e.g. iOS Low Power Mode) the preview
play()promise stays pending; a viewer clicking to play with a gesture commits real playback, but the later rejection then ranstopPreview()— pausing the real video, resetting it to 0 and restoring the poster. The settled-promise handlers now bail whenisVideoClickedis already true (both the.catchteardown and the.thenmute re-apply). Added regression tests.Not changed — false positive
Finding 2 (
library._requery( true )inpages/media-library/data/media-grid.js): onupload.phpthe library is core'swp.media.model.Attachments, whose_requery(refresh)takes a boolean — sotrueis the correct core contract. The GoDAM-overridden_requery(props)collection is only instantiated for the GoDAM tab (viagetQuery), where move-to-folder doesn't run, so it never throws in the actual move flow.Testing
npm run test:unit— 303 passing (3 new hover-race tests).npm run build:prod— compiles cleanly.php -l uninstall.phpclean.🤖 Generated with Claude Code