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

Fix Video Unavailable problem at YouTube preview #26980

Merged
merged 28 commits into from
Aug 22, 2024
Merged

Conversation

Sn-Kinos
Copy link
Contributor

@Sn-Kinos Sn-Kinos commented May 9, 2024

Summary

Fixed the problem that YouTube preview shows Video Unavailable instead of the video.

  • Added the properties on the iframe for YouTube preview at youtube_video.tsx

Reproduce

Create a post that occurs Video Unavailable problem. I used https://youtu.be/edsx_MOhVnk on the below screenshots.

Ticket Link

No Tickets. (less than 20 lines of code change)

Screenshots

I haven't change the UI. But I can show about it w/ screenshots.

before after
image image

Release Note

Fixed the problem that YouTube preview shows Video Unavailable instead of the video.

@mm-cloud-bot mm-cloud-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 9, 2024
@mattermost-build
Copy link
Contributor

Hello @Sn-Kinos,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@pvev
Copy link
Contributor

pvev commented May 9, 2024

hey @Sn-Kinos , thank you for your contribution. Could you please describe the exact steps on how to reproduce the issue you are trying to solve so we can create a ticket and associate it with this fix? Thanks!

@Sn-Kinos
Copy link
Contributor Author

hey @Sn-Kinos , thank you for your contribution. Could you please describe the exact steps on how to reproduce the issue you are trying to solve so we can create a ticket and associate it with this fix? Thanks!

Thanks @pvev! I added the reproduce section on the text :D

@Sn-Kinos Sn-Kinos marked this pull request as draft May 14, 2024 04:05
@Sn-Kinos Sn-Kinos marked this pull request as ready for review May 14, 2024 04:05
@Sn-Kinos Sn-Kinos marked this pull request as draft May 22, 2024 04:59
@Sn-Kinos Sn-Kinos marked this pull request as ready for review May 22, 2024 04:59
@Sn-Kinos
Copy link
Contributor Author

@pvev I wonder if there's anything else I need to do 🏃‍♂️

@pvev pvev requested review from pvev and hmhealey May 27, 2024 07:27
@pvev pvev added the 2: Dev Review Requires review by a developer label May 27, 2024
@pvev
Copy link
Contributor

pvev commented May 27, 2024

@pvev I wonder if there's anything else I need to do 🏃‍♂️

Thanks @Sn-Kinos we will start the dev review and security review and QE process now. We will keep you posted.

@pvev pvev requested review from larkox and removed request for hmhealey May 27, 2024 07:30
Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

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

Codewise, LGTM. Waiting for security review.

@larkox larkox added 3: QA Review Requires review by a QA tester. May occur at the same time as Dev Review 3: Security Review Review requested from Security Team labels May 27, 2024
@unified-ci-app
Copy link
Contributor

E2E test triggered successfully for PR #26980. The corresponding commit's status check will be available shortly.

Copy link

E2E test run is starting for commit 88e5376dec80ff16ddcdb4cee8650aa44e87bb6a.
You can check its progress by either:

Copy link
Member

@hmhealey hmhealey left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @Sn-Kinos! I always assumed that the fact that YouTube videos didn't play for me in MM was something on my end, not that we were missing some things on the iframe. Great find!

@hmhealey hmhealey dismissed their stale review May 29, 2024 13:44

No changes needed about what I commented on

@pvev
Copy link
Contributor

pvev commented Jun 1, 2024

@Sn-Kinos sorry that this review is taking longer that normal, but there are some security concerns about this change that are being discussed internally. As soon as we define an action, we will let you know. Thanks.

@Sn-Kinos
Copy link
Contributor Author

Sn-Kinos commented Jun 3, 2024

@Sn-Kinos sorry that this review is taking longer that normal, but there are some security concerns about this change that are being discussed internally. As soon as we define an action, we will let you know. Thanks.

I understand. I referred this iframe code from another commercial messenger app. I hope it can help you.

@pvev
Copy link
Contributor

pvev commented Jun 7, 2024

@Sn-Kinos, thank you for your patience. The decision to use the referrer policy strict-origin-when-cross-origin can expose some sensitive information, which may be considered more or less critical depending on the use case. Therefore, this decision should be made by the workspace administrator.

Given this, the idea is to make this value configurable through a parameter in the admin console. I wanted to ask if you would like to add this new configuration parameter and set the referrer policy based on that parameter (I would help and guide you through this process). Alternatively, I can merge your PR as it is and then take care of adding this configuration parameter in a subsequent PR.

@Sn-Kinos
Copy link
Contributor Author

Sn-Kinos commented Jun 7, 2024

@pvev I prefer a subsequents PR. I thought there would be no problem because I brought the parameters used in Slack as it is, but I guess it wasn't?

@larkox
Copy link
Contributor

larkox commented Jul 26, 2024

/update-branch

@larkox
Copy link
Contributor

larkox commented Jul 26, 2024

@Sn-Kinos Seems like a hiccup in the CI. Let's see if re-running the CI solves it

@mm-cloud-bot
Copy link

New commit detected. SpinWick will upgrade if the updated docker image is available.

@mm-cloud-bot
Copy link

Test server creation failed. Review the error details here.

@yasserfaraazkhan
Copy link
Contributor

/update-branch

@mm-cloud-bot
Copy link

New commit detected. SpinWick will upgrade if the updated docker image is available.

@mm-cloud-bot
Copy link

Mattermost test server updated with git commit 052e5ef734dcc373177b88d2716cea0fc4f508aa.

Access here: https://mattermost-pr-26980.test.mattermost.cloud

Copy link
Contributor

@yasserfaraazkhan yasserfaraazkhan left a comment

Choose a reason for hiding this comment

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

able to play the video now.
Thank you @Sn-Kinos

@Sn-Kinos
Copy link
Contributor Author

Sn-Kinos commented Aug 1, 2024

I'm waiting to develop YouTube Shorts layout. Is it only the Security Review left now? Or is there anything else I can do?

@larkox
Copy link
Contributor

larkox commented Aug 8, 2024

@esarafianou Can you confirm this change?

Copy link
Contributor

@esarafianou esarafianou left a comment

Choose a reason for hiding this comment

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

@larkox code looks good but we need someone from Product to agree on adding a new experimental option since we now better track the different product lifecycle paths (experimental - alpha - beta - GA). Adding it as under ExperimentalSettings is another thing we need Product to agree on as this makes moving the option out of experimental a breaking change (needing to change the config name).

@wiersgallak can you let us know what you think?

@larkox larkox added 1: PM Review Requires review by a product manager and removed 3: QA Review Requires review by a QA tester. May occur at the same time as Dev Review 3: Security Review Review requested from Security Team labels Aug 12, 2024
@wiersgallak
Copy link
Contributor

@esarafianou From what I understand, as long as the word "experimental" is not included in the configuration name and it is just under the experimental config setting location, we can move the config setting location without changing the full name of it.

@Sn-Kinos
Copy link
Contributor Author

@esarafianou From what I understand, as long as the word "experimental" is not included in the configuration name and it is just under the experimental config setting location, we can move the config setting location without changing the full name of it.

Is there anything to do for me to solve it?

@pvev
Copy link
Contributor

pvev commented Aug 21, 2024

@Sn-Kinos I think this is ready now to merge. Thank you very much for your contribution and for your patience during our review. Our QE process makes exhaustive reviews to any bit we will put in our code base to always guarantee the best quality and security.

@pvev pvev merged commit 283f59b into mattermost:master Aug 22, 2024
34 checks passed
@mattermost-build mattermost-build removed the Setup Cloud Test Server Setup an on-prem test server label Aug 22, 2024
@amyblais amyblais added Changelog/Done Required changelog entry has been written Docs/Not Needed Does not require documentation Docs/Needed Requires documentation and removed Docs/Not Needed Does not require documentation labels Aug 22, 2024
@amyblais amyblais added this to the v10.1.0 milestone Aug 27, 2024
hereje pushed a commit to hereje/mattermost that referenced this pull request Aug 29, 2024
* Fix YouTube preview shows Video Unavailable

* Fix typo on iframe property

* Remove duplicated property

* fix lint error (double-quotes, unknown property)

* renew snapshot for youtube_video.tsx

* fix double quotes and newline error on snapshot for youtube_video.tsx

* fix blank on snapshot for youtube_video.tsx

* Add YouTube Shorts Embed Preview

* Revert "Add YouTube Shorts Embed Preview"

This reverts commit b5fb7a4.

* Add setting for Youtube Referrer Policy

* fix test code error about Youtube Referrer Policy

* remove mistake changes on `webpack.config.js`

* add test and snapshot about `youtubeReferrerPolicy = true`

* fix errors on ci

* update description of YouTube Referrer Policy

* remove unnecessary whitespace in default_config.ts

* remove ko.json changes to prevent conflict with translate tool

* update snapshot of `youtube_video.test.tsx`

* referrerPolicy on `youtube_video` didn't follow global policy value

mattermost#26980 (comment)

* update snapshot of `youtube_video.test.tsx`

* Remove obsolete snapshot

* fix typo on index.ts @ youtube_video

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
@cwarnermm cwarnermm removed the Docs/Needed Requires documentation label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1: PM Review Requires review by a product manager Changelog/Done Required changelog entry has been written Contributor release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.