Skip to content

Conversation

@kaeizen
Copy link
Contributor

@kaeizen kaeizen commented Nov 20, 2025

Summary by CodeRabbit

  • Bug Fixes
    • More reliable handling of video metadata: upload dates are now extracted safely (avoiding errors when dates are missing or invalid) and missing video descriptions default to an empty value, preventing failures during media selection or URL changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

Safely computes videoUploadDate from media.date (tries toISOString, falls back to Date parsing; on error leaves undefined) and ensures videoDescription defaults to an empty string; URL-change reset logic updated to use the guarded date extraction.

Changes

Cohort / File(s) Summary
Video metadata parsing & defaults
src/block/video-popup/edit.js
Introduces guarded extraction of videoUploadDate from media.date (attempt toISOString()new Date(media.date).toISOString(); on error keep undefined); sets videoDescription default to ''; update reset-path to apply the safe assignment rather than calling toISOString() directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the fallback chain: direct toISOString() when already a Date, then new Date(media.date) parsing, and that errors leave videoUploadDate undefined.
  • Confirm videoDescription default ('') and videoUploadDate being undefined don't break downstream consumers.
  • Check URL-change/reset branch uses the guarded assignment and that other fields (videoLink, videoId, videoName) remain unchanged.

Poem

🐰 I nudged the date, then gave it care,
If time is shy, I leave it bare.
Descriptions hum with empty cheer,
Safe defaults hop ever near. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing an upload date error in the video popup component when handling newly uploaded videos.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/video-popup-error-when-selecting-video

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f9c54f and 4c0f29a.

📒 Files selected for processing (1)
  • src/block/video-popup/edit.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/block/video-popup/edit.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: PHP 8.2 and WP 6.7.2
  • GitHub Check: PHP 8.2 and WP latest
  • GitHub Check: PHP 8.2 and WP 6.6.2
  • GitHub Check: PHP 7.3 and WP latest
  • GitHub Check: PHP 8.2 and WP 6.5.5
  • GitHub Check: PHP 7.3 and WP 6.5.5
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kaeizen kaeizen self-assigned this Nov 20, 2025
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

🤖 Pull request artifacts

file commit
pr3641-stackable-3641-merge.zip 4c0f29a

github-actions bot added a commit that referenced this pull request Nov 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9338467 and 7f9c54f.

📒 Files selected for processing (1)
  • src/block/video-popup/edit.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: PHP 8.2 and WP latest
  • GitHub Check: PHP 7.3 and WP latest
  • GitHub Check: PHP 8.2 and WP 6.7.2
  • GitHub Check: PHP 8.2 and WP 6.6.2
  • GitHub Check: PHP 8.2 and WP 6.5.5
  • GitHub Check: PHP 7.3 and WP 6.5.5
  • GitHub Check: build
🔇 Additional comments (1)
src/block/video-popup/edit.js (1)

201-202: Good fallback handling for videoDescription.

The use of media.description || '' correctly ensures the attribute defaults to an empty string when the description is missing. However, ensure the videoUploadDate logic in lines 186-196 is fixed so that it consistently provides an empty string fallback as well.

github-actions bot added a commit that referenced this pull request Nov 20, 2025
@bfintal bfintal merged commit 1489019 into develop Nov 21, 2025
8 of 9 checks passed
@bfintal bfintal deleted the fix/video-popup-error-when-selecting-video branch November 21, 2025 12:52
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.

3 participants