Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNMobile: Fix edge case where VideoPress v5 could mistakenly appears empty #35957

Merged
merged 3 commits into from Feb 27, 2024

Conversation

SiobhyB
Copy link
Contributor

@SiobhyB SiobhyB commented Feb 26, 2024

Fixes wordpress-mobile/gutenberg-mobile#6670

Proposed changes:

  • It is valid that the Video block does not have an ID associated with it in some cases after uploading a video via a URL. However, those videos can still be valid VideoPress URLs with a GUID (as well as other VideoPress metadata). At the moment, the block's isSourcePresent bool returns false in these cases, leading to the block falsely appearing empty.
  • To resolve this edge case, the check for a valid ID within isSourcePresent has been removed in 8f1a4c3. It is only necessary for a video to either have a valid src or GUID to confirm that a source is present.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

N/A

Does this pull request change what data or activity we track or use?

No, it does not.

Testing instructions:

  • Copy the following URL: https://videos.files.wordpress.com/qDiVCMnq/0e2809330-1-2.mp4. This URL was obtained by getting the download URL from the VideoPress player.
  • Create a post in a Simple site.
  • Add a Video block.
  • Insert the copied URL.
  • Observe that the video can be played within the editor.
  • Save the post and open it again.
  • Observe that the post is marked as dirty. In this step, the video URL changed to the regular VideoPress URL. Note, this happens within the shared save.js file.
  • Save the post and open it again.
  • Verify that the block is not in the empty state.

@SiobhyB SiobhyB added [Type] Bug When a feature is broken and / or not performing as intended [Block] VideoPress labels Feb 26, 2024
Copy link
Contributor

github-actions bot commented Feb 26, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the rnmobile/fix-empty-videopress-v5-block-when-no-id branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack rnmobile/fix-empty-videopress-v5-block-when-no-id
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress labels Feb 26, 2024
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for March 5, 2024 (scheduled code freeze on March 4, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@SiobhyB SiobhyB changed the title Rnmobile/fix empty videopress v5 block when no RNMobile: Fix edge case where VideoPress v5 could sometimes mistakenly appear empty Feb 26, 2024
@SiobhyB SiobhyB changed the title RNMobile: Fix edge case where VideoPress v5 could sometimes mistakenly appear empty RNMobile: Fix edge case where VideoPress v5 could mistakenly appears empty Feb 26, 2024
@SiobhyB SiobhyB marked this pull request as ready for review February 26, 2024 17:23
Copy link
Member

@derekblank derekblank left a comment

Choose a reason for hiding this comment

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

LGTM! When testing on a simple site in the context of WordPress/gutenberg#59378, I was able to observe the "before" state where the Video block was marked empty after saving and re-opening.

With the PR changes applied, I observed the Video block was not marked empty after saving and re-opening the post. 🚀

Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

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

LGTM 🎊 !

Observe that the post is marked as dirty. In this step, the video URL changed to the regular VideoPress URL. Note, this happens within the shared save.js file.

Ideally, the app should provide the block's markup to avoid being marked as dirty. Similarly, it would be great to match the markup produced in the web version to avoid extra updates. Not a blocker for this PR but I wonder if we could explore this improvement as part of the project Video block improvements

@fluiddot
Copy link
Contributor

@SiobhyB I haven't found the companion GBM PR to update the Jetpack reference. Let us know when it's created to give approval. Thanks 🙇 !

@SiobhyB
Copy link
Contributor Author

SiobhyB commented Feb 27, 2024

Thanks for the review both!

Similarly, it would be great to match the markup produced in the web version to avoid extra updates. Not a blocker for this PR but I wonder if we could explore this improvement as part of the project Video block improvements

Good point, I've added this as a task to look into on the project board, and will create a follow up issue later on as part of that. 🙇‍♀️

I haven't found the companion GBM PR to update the Jetpack reference. Let us know when it's created to give approval. Thanks 🙇 !

I have three Jetpack PRs that will be potentially merged very close together (this one, #35961, and potentially another today). I was thinking of creating a single companion PR referencing all three once they're merged, in an attempt to avoid PR-overload. :D I'll request your review when I create that! I'd also be happy to create a separate one now if you don't think waiting is a good idea.

@SiobhyB SiobhyB merged commit 9123233 into trunk Feb 27, 2024
52 checks passed
@SiobhyB SiobhyB deleted the rnmobile/fix-empty-videopress-v5-block-when-no-id branch February 27, 2024 11:27
@github-actions github-actions bot added this to the jetpack/13.2 milestone Feb 27, 2024
@fluiddot
Copy link
Contributor

fluiddot commented Feb 27, 2024

I was thinking of creating a single companion PR referencing all three once they're merged, in an attempt to avoid PR-overload. :D I'll request your review when I create that! I'd also be happy to create a separate one now if you don't think waiting is a good idea.

Sounds good. Makes sense to me to wait to batch multiple changes from Jetpack in a single PR 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty state when using source URL of VideoPress vide in v5 block
3 participants