-
Notifications
You must be signed in to change notification settings - Fork 798
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
Social: Fix frontend media validation logic #38234
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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. |
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.
Thanks for working on this, Geri!
The code makes logical sense, but I found the following use-case to be an outlier.
- I connected Facebook and Instagram both.
- I attached a custom image with 10MB after purchasing the paid plan
- I had auto-conversion off, but only Instagram was disabled. It could very well be that the Facebook image maximum allowed size is bigger than that, but it appears to be 8MB. Shouldn't Facebook be disabled too?
![Screenshot 2024-07-09 at 11 12 55 AM](https://cdn.statically.io/img/private-user-images.githubusercontent.com/6594561/346827718-c9f2d570-da64-43a9-ba5c-e1160f54a87a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1NTAwMzAsIm5iZiI6MTcyMzU0OTczMCwicGF0aCI6Ii82NTk0NTYxLzM0NjgyNzcxOC1jOWYyZDU3MC1kYTY0LTQzYTktYmE1Yy1lMTE2MGY1NGE4N2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTNUMTE0ODUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDgzY2IxY2I3YjQ3MThlMjFhOWMwNzExNzUzNDBhZmNkMzJhYTlhNWQyY2ZjYzZkMDVkZWJlMGY1NDYyMTQ0YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.tSINAa_YPvDheV_W7pq8ohyaBIf__G-s_xyPN4q4l-Y)
Some additional things to test:
- Have auto-conversion turned off on simple sites, you can do that from Jetpack Social MC. Auto-conversion is enabled by default on simple sites, so shouldn't be a problem.
- Patch this diff on a simple site and see if your fix solves the issue there for the featured image. It should do that 99.99%, but would be good to test.
I also noticed that we should update the documentation here https://jetpack.com/support/jetpack-social/convert-images-for-sharing/#understanding-platform-specific-media-requirements with the new social networks and their specifications. I will do that.
@spsiddarthan thanks for noticing. I had this fixed locally yesterday but that commit didn't get pushed, sorry! 🤦 Downside of juggling 4 PRs I guess 😅 |
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.
Works well!
Fixes https://github.com/Automattic/jpop-issues/issues/9123
This issues is that we are validating the featured image when the validation is not necessary, because the image won't get uploaded anywhere. The only edge case is Instagram
Proposed changes:
attachedMedia.length
instead of the removedshouldUploadAttachedMedia
Other information:
Jetpack product discussion
https://github.com/Automattic/jpop-issues/issues/9123
Does this pull request change what data or activity we track or use?
No.
Testing instructions: