WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Copy the exported file to a temporary dir instead of the local Media dir

Open crazytonyli opened this issue 5 months ago • 4 comments

Description

Fix #23025. This PR supersedes #24570, to address the issue raised in https://github.com/wordpress-mobile/WordPress-iOS/pull/24570#discussion_r2136074822.

Testing instructions

Verify that issue #23025 is fixed on WP.com sites and self-hosted sites.

Verify that photos, GIFs, and videos can be uploaded.

crazytonyli avatar Jun 18 '25 03:06 crazytonyli

1 Warning
:warning: This PR is assigned to the milestone 26.0. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by :no_entry_sign: Danger

dangermattic avatar Jun 18 '25 03:06 dangermattic

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number27873
VersionPR #24595
Bundle IDorg.wordpress.alpha
Commitc52ee05021dc8a5ed4b9176510e90a1ad6519e29
Installation URL4r35f5oaa730g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

wpmobilebot avatar Jun 18 '25 04:06 wpmobilebot

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number27873
VersionPR #24595
Bundle IDcom.jetpack.alpha
Commitc52ee05021dc8a5ed4b9176510e90a1ad6519e29
Installation URL2jghek33a4ja0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

wpmobilebot avatar Jun 18 '25 04:06 wpmobilebot

I suggest capturing the name of the file immediate after it's loaded from the item provider and passing it here:

@kean Do you mean adding this change on top of of this PR, or using your suggested change without this PR?

There is another non-user-facing issue, along with the issue of "-1" in the uploaded image. When uploading an image, two image files are copied to the "local media directory": "foo.png" and "foo-1.png", which I'd like to fix too. There is no reason to store unused large files in the app's sandbox.

crazytonyli avatar Jun 23 '25 00:06 crazytonyli

I'd probably suggest implementing it as a new/alternative fix, if you agree, of course.

When uploading an image, two image files are copied to the "local media directory": "foo.png" and "foo-1.png", which I'd like to fix too.

That's a good idea as these could really add up. It needs to remove temporary files after processing and remove everything after upload. There may be some code already doing it.

kean avatar Jun 23 '25 19:06 kean

When uploading an image, two image files are copied to the "local media directory": "foo.png" and "foo-1.png", which I'd like to fix too.

That's a good idea as these could really add up.

Sorry, I was not clear at all in my previous comment. The issue of duplicated image files in the "local media directory" is also fixed in this PR.

Considering this PR fixes the issue with the uploaded media file name, and the issue I mentioned above regarding having duplicated image files in the "local media directory", I think we can take this PR's changes for now?

crazytonyli avatar Jun 24 '25 10:06 crazytonyli