File Block : Link To - attachment page issue #27121
Labels
[Block] File
Affects the File Block
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Type] Bug
An existing feature does not function as intended
Projects
Describe the bug
The details below were originally reported by @etoledom on this PR for the File Block mobile project.
I have found one weird behaviour (this happens in both WPiOS and WPAndroid):
The attachment link will sometimes be broken when I test it on a preview.
To reproduce
I took a look at the code and it looks good to me. I check the media object on web and it returns the correct link property:
-> "link": "https://mysitefortestingetoledom.wordpress.com/?attachment_id=3722",
"title": {
"raw": "bugreport-daisy-PKQ1.180917.001-2019-09-25-13-38-52.zip",
"rendered": "bugreport-daisy-PKQ1.180917.001-2019-09-25-13-38-52.zip"
},
...
On a next test, I checked out the first URL that is returned after uploading the file from mobile.
This link is working as expected:
--> link = "https://mysitefortestingetoledom.wordpress.com/charactersheet_3pgs_-complete-2/";
"media_details" = {
After a while, (literally, I did nothing fancy) the link for the same file changed, and the previous one became broken:
--> link = "https://mysitefortestingetoledom.wordpress.com/?attachment_id=3731";
"media_details" = {
I haven't been able to reproduce this same behaviour on web only, and again, I didn't spot anything wrong on the mobile side of the code.
It seems to happen when I upload a non-image file from mobile.
As a last test I tried uploading the same file, once from mobile and once from web.
First from mobile, it returned this link:
https://mysitefortestingetoledom.wordpress.com/christmas-time/
As I was expecting, it became broken and changed to:
https://mysitefortestingetoledom.wordpress.com/?attachment_id=3740
Then uploading the same file from web, it returned this link:
https://mysitefortestingetoledom.wordpress.com/christmas-time-1/
And this link seems to still be good now and haven't gotten broken.
My first guess is that we are doing something different with the upload request, maybe we are sending some different parameters. Or perhaps the backend is treating differently files uploaded from web and from mobile.
Expected behavior
The link should never be broken and the behavior should be consistent with the web.
The text was updated successfully, but these errors were encountered: