Skip to content

Fix v2.2.2 review findings: skip-button preview, uninstall cleanup, hover race - #2120

Open
KMchaudhary wants to merge 1 commit into
developfrom
hotfix/release-2.2.2
Open

KMchaudhary wants to merge 1 commit into
developfrom
hotfix/release-2.2.2

Conversation

@KMchaudhary

Copy link
Copy Markdown
Collaborator

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) in media-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 (normalizeSkipButtons in configurationManager.js). The Video Editor's Settings preview instead treated any non-zero value as valid and hid the buttons at 0/missing — so a legacy/invalid value like 7 or 20, or a missing value, produced a preview that didn't match what the front end renders.

  • Exported normalizeSkipButtons (and its constants) from configurationManager.js as the single source of truth.
  • VideoEditor.js seeds previewControlBar.skipButtons through it.
  • VideoJSPlayer.js runs the live-sync duration through it too.

2. uninstall.php leaves 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 ran stopPreview() — pausing the real video, resetting it to 0 and restoring the poster. The settled-promise handlers now bail when isVideoClicked is already true (both the .catch teardown and the .then mute re-apply). Added regression tests.

Not changed — false positive

Finding 2 (library._requery( true ) in pages/media-library/data/media-grid.js): on upload.php the library is core's wp.media.model.Attachments, whose _requery(refresh) takes a boolean — so true is the correct core contract. The GoDAM-overridden _requery(props) collection is only instantiated for the GoDAM tab (via getQuery), 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.
  • ESLint clean; php -l uninstall.php clean.

🤖 Generated with Claude Code

…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.
Copilot AI balanced review requested due to automatic review settings September 14, 2026 13:17

Copilot AI 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.

🟡 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;
@github-actions

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
16 0 16

⚠️ Warnings (16)

📁 composer.json (1 warning)
📍 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants