-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Video preview isssue #30324 #31770
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
base: 2.4-develop
Are you sure you want to change the base?
Video preview isssue #30324 #31770
Conversation
Hi @gixid192. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
@magento run all tests |
@magento run all tests |
@magento run all tests |
@magento run Functional Tests B2B |
@magento give me test instance |
Hi @danielrussob. Thank you for your request. I'm working on Magento instance for you. |
@magento give me 2.4-develop instance |
Hi @danielrussob. Thank you for your request. I'm working on Magento instance for you. |
Hi @danielrussob, here is your Magento Instance: https://f2e1e753c097aa7081e0c62821e83d39.instances.magento-community.engineering |
Hi @danielrussob, here is your Magento Instance: https://f2e1e753c097aa7081e0c62821e83d39-2-4-develop.instances.magento-community.engineering |
Issue Reproduced on vanilla Magento 2.4 |
Issued (just as described) are solved on new Magento instance |
@@ -1103,6 +1104,7 @@ define([ | |||
this._previewImage = null; | |||
} | |||
this._tempPreviewImageData = null; | |||
this._videoUrlWidget.trigger('cancelled_video_information'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @gixid192 ,
thank you for your contribution.
I have two questions for you:
a. Can you write a test for this PR?
b. I have found a new bug, I tell you a step to reproduce the bug:
b.1. Navigate to Add New Product page in backend
b.2. Open Image And Videos section
b.3. Click on Add Video button
b.4. Enter Vimeo or YouTube video URL in Url field and wait until the Save button is enabled
b.5. Click on Save button
b.6. Click on Add Video Button
b.7. paste URL in Url input, click Title and quickly click on X to close
b.8. Press on Add Video button
b.9. See an Preview Image (bottom left corner) from the previous video
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @danielrussob,
- I'm not sure how to write test for this case. Could you suggest some ideas?
- Did you try this new case with the code in the PR or the original code? With the PR's code, it stop the render part right after you close X, so there will be no b.8/b.9
I tried it myself, couldn't reproduce the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
for point 2, i have tested it on your PR, if you want we can schedule a chat on slack of Magento Community Engineering
to reproduce the issue (you can found me with name Daniel Russo)
for point 1, see comment of @sivaschenko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
So I tried again and reproduced the issue.
There's another ajax in the update image-placeholder:
magento2/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js
Line 393 in cd857f9
$.ajax({ |
I made the same approach and it fixed the problem! However, I don't understand the purpose of that _loadRemotePreview
function.
The _loadRemotePreview
function does 2 things:
- Send request to server to save the image
- Only show the preview_image if the request above success.
The thing is those 2 things are not related, it does not take data from the request to show for users (instead the preview_image is taken from video's api). Also, if the request fail, there is no error handle for it (and the preview_image still show)
Should we split this function into 2 small separated ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielrussob: I updated new code to fix the issue you reported, just write new code, no splitting; kindly have a look when you have time.
If you have options on this split into 2 functions
, please let me know.
@danielrussob @gixid192 I think that MFTF test covering this fix may not be reliable as the fixed behaviour depends on the server response time. I'd advise covering the fix with a javascript jasmine test. https://devdocs.magento.com/guides/v2.4/test/js/jasmine.html |
@sivaschenko Thanks for the suggestions, I will try to cover the test, never write testes in Js before 😅 |
@magento give me 2.4-develop instance |
Hi @danielrussob, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
@magento run all tests |
Summary
This PR fix the #30324
The error as I understand is caused by not cancelling the video-api request. More on description below.
Description (*)
Fixed Issues (if relevant)
#30324
Manual testing scenarios (*)
Contribution checklist (*)