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

URLSession feature flag leads to broken video uploads on self-hosted sites #22659

Closed
SiobhyB opened this issue Feb 21, 2024 · 3 comments · Fixed by wordpress-mobile/WordPressKit-iOS#734 or #22666

Comments

@SiobhyB
Copy link
Contributor

SiobhyB commented Feb 21, 2024

Expected behavior

Videos uploaded to self-hosted sites should function as expected.

Actual behavior

With non-production builds, videos are currently being uploaded with an invalid format to self-hosted sites. This happened following the change in #22540, which defaulted to using URLSession in WordPressKit (instead of Alamofire).

An error like the following can be seen when attempting to view iOS-uploaded videos in the media library on the web:

Media error: Format(s) not supported or source(s) not found[Download](https://example.com.mp4?_=4)

Additionally, when uploaded to the editor, the videos won't play back.

Note, this isn't an issue on dotcom or Jetpack-connected sites, only self-hosted sites with no Jetpack connection.

Steps to reproduce the behavior

  • Set up a self-hosted site that doesn't have the Jetpack plugin enabled.
  • Download a non-production build of the iOS, such as the installable build generated with this PR.
  • Navigate to the post/page editor for your self-hosted site.
  • Add the video block and choose the option to upload a video from your device.
  • Observe that the block's thumbnail is blank and tapping to play results in a blank player.
  • On the web, navigate to the site's media library and view the following error alongside the uploaded video: Media error: Format(s) not supported or source(s) not found[Download](https://example.com.mp4?_=4)

The feature flag that enables URLSession in WordPressKit can be toggled off via MeApp SettingsFeature Flags (note, I found it necessary to reboot the app for these changes to take effect). Toggling the flag off, however, doesn't fix the issue and leads to failed video uploads.

Tested on iPhone XR, iOS 17.3.1, Jetpack iOS / WordPress iOS non-production builds only
@dangermattic
Copy link
Collaborator

Thanks for reporting! 👍

@SiobhyB
Copy link
Contributor Author

SiobhyB commented Feb 21, 2024

@crazytonyli, I wanted to surface this issue for you. Would you be able to take a look? With the current state, it's tricky to manually test whether changes to the video block work as expected for self-hosted sites, as all uploads are failing for non-production builds.

@crazytonyli
Copy link
Contributor

@SiobhyB Thanks for reporting the issue! I have created a fix in wordpress-mobile/WordPressKit-iOS#734. I'll update the app once the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants