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

Some uploaded images have device path for src, not the image URL on the blog. #5923

Closed
aerych opened this issue Aug 29, 2016 · 36 comments
Closed

Comments

@aerych
Copy link
Member

aerych commented Aug 29, 2016

Reported in the forums:

Using the current iOS (iPad) Wordpress app to post to a self-hosted (absolutely up-to-date) WordPress Install

Images are uploading 100% AOK but the links in the posts are wrong/nonsense - likely the file on the iPad and not the site?

They looking like

<img data-wpid="2BD088EC-EAC7-4879-8B26-ABDAE30C4261" src="/var/mobile/Containers/Data/Application/9EB99EF4-F0D2-4F4E-850B-4A6F493AC6F5/Documents/Media/img_1230-thumbnail.jpeg" alt="">

Opening this issue to track.

@aerych aerych added this to the 6.5 milestone Aug 29, 2016
@mattdoble89
Copy link

This one is causing me huge issues with our multisite install and iOS app. Any updates?

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

cc @SergioEstevao

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

@mattdoble89, its been a tricky one to nail down.

Have you seen any error message while uploading images? If so, can you describe them in detail?

Also, in the app you can look under Me > Help & Settings and enable Extra Debug. Then reproduce the issue. Then look under Me > Help & Settings > Activity Logs to see if the Current Log has captured any errors. You can share the log here if you like.

We'd be keen on trying to troubleshoot this one directly if you'd be willing to share some credentials for a test account with an editor role. If so, you could email them to "mobile at automattic dot com" (note the three 't's in automattic).

@mattdoble89
Copy link

OK, thank you for looking. It is causing me major pain. It is intermittent for us, it works one minute and not the next, when it doesn't work it simply loads the image in greyscale, and never goes full colour.

I have just emailed you a set of details. Hopefully this will prove useful. I will lookup errors logs, although sure you can reproduce these quickly.

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

Thanks Matt. We've received the email. We really appreciate the chance to work on this. @SergioEstevao or I will follow up here with what we find.

@mattdoble89
Copy link

OK, cheers guys. Hopefully this helps, any additional info let me know. Hope you have been able to replicate the error??

The site itself is all behind SimpleSAML authentication, so you will need to login even to view site, but the issue was happening before this was installed.

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

Hope you have been able to replicate the error??

So far no, but I'm still trying different things hoping to find the right trigger.

The site itself is all behind SimpleSAML authentication, so you will need to login even to view site, but the issue was happening before this was installed.

That's good to know. I noticed I'm prompted to relogin after 10 minutes of inactivity in the admin and I wondered if it could be related. I'm guessing that is a feature of SimpleSAML?

@mattdoble89
Copy link

Mm, OK, we normally get it every five or so uploads on iOS. Try with different images, we have always replicated very quickly.

I had not noticed that, I will look into it.

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

@mattdoble89 a couple of quick questions

when it doesn't work it simply loads the image in greyscale, and never goes full colour.

When this happens, is the image overlaid with an error message and a "Retry" button, or is it just the image in a grayscale/disabled state?

Also, does this happen while the app is active and in the foreground or when a user has pressed the home button to background the app?

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

More questions (sorry)

we normally get it every five or so uploads

Any more details on this? Is it one image per post, or multiple images for a single post?

Also, it would be helpful to know if when it happens the image has actually uploaded successfully to the blog.

@mattdoble89
Copy link

The image is greyscale, the loading bad along the top of the image makes it to 100% but the spinning wheel stays on the app forever, never completing or erroring. This happens when the app is in the foreground and active. The user can press back, and the post appears in the post list and looks to have posted, however the image is not shown in the preview list of all posts.

We ask users to upload one image per post, it may also happen with more than one but definitely happens with one.

I will login to the server now and see if I can find an image I know it happened with earlier.

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

Good info. Thank you!

@mattdoble89
Copy link

Yes, the images are indeed uploaded to the uploads folder, and in a range of dimensions. The URL to the image is however:

https://portfolio.gryphon.dorset.sch.uk/var/mobile/Containers/Data/Application/B43122E8-92D1-40B5-8D80-CC1E46634D5C/Documents/Media/img_1634-thumbnail.jpeg

@mattdoble89
Copy link

Hope this helps!

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

Finally reproduced this on an iPhone 5, and an iPhone 6s. My steps to reproduce:

  • Create a new post, add a title, some text and insert an image from either taken by the camera or from the camera roll.
  • Monitor the upload progress. The moment the upload completes (the image switches to full color, but the spinner might still be present) quickly tap the Post button to publish.
  • Edit the post again and check HTML markup. If you were successful at reproducing the bug you'll see the local image url, and the img tag wrapped in a span instead of an anchor.

In this particular circumstance timing appears to be a factor and it seems like a bit of a race condition. Perhaps due to saving on a derived context and updating the main context asyncronously, but I haven't dug into it that far yet.

This doesn't seem like a perfect fit for the never ending spinner that Matt described. However, it looks like that could potentially be attributed to a networking issue. Notice that the failure block in WPPostViewController uploadMedia:trackingId: has a conditional whose else clause is missing a call tostopTrackingProgressOfMediaWithId. @mattdoble89 if you get a chance to review the app's activity logs (with Extra Debug enabled) I'd be curious to know if there are any lines beginning Failed Media Upload: and what information was recorded there.

In any event, it looks like we have two potential angles of attack:

  1. Find and squash the assumed race condition
  2. Improve how that else clause handle's failure.

@SergioEstevao thoughts?

@SergioEstevao
Copy link
Contributor

@aerych two notes:

  1. The race condition is possible but you shouldn't be able to post until all the media is uploaded and replaced.
  2. the code is correct we don't stop tracking the progress for that media id because we still want to retry it.

@aerych
Copy link
Member Author

aerych commented Oct 3, 2016

we don't stop tracking the progress for that media id because we still want to retry it.

Ah. I think I misunderstood what stopTrackingProgressOfMediaWithId was doing. Thanks for clarifying. :)

@SergioEstevao
Copy link
Contributor

@aerych investigated a bit more and it looks option 1) the race condition is happening. If you are very quick to press post or update after the image upload is done you get that inconsistent state.

@aerych
Copy link
Member Author

aerych commented Oct 4, 2016

@mattdoble89 would you be game to test our fix for the race condition and see if it also takes care of the issue you're seeing? I'm hopeful but not 100% sure its the same bug. We can email you a link to a patched version of the app to test with.

Edit: Link sent just in case :)

@mattdoble89
Copy link

Yes please, very keen to test. Also not sure it is the same, ours is unrelated to the button press and happens regardless, but I am hopeful! I dont seem to have received link though?

@aerych
Copy link
Member Author

aerych commented Oct 4, 2016

@mattdoble89 I forwarded another copy. Its coming from my automattic email address and is titled "Link to test a patched version of WordPress for iOS".

@mattdoble89
Copy link

Thanks for the email, but I am now getting "Error occurred during Publishing" message, and the post remains local only.

@mattdoble89
Copy link

Also, if I go in and edit a previous post, the images are removed upon update.

@SergioEstevao
Copy link
Contributor

Do you get this error when uploading the image? or after you press post?

On Wed, Oct 5, 2016 at 8:55 AM, mattdoble89 notifications@github.com
wrote:

Thanks for the email, but I am now getting "Error occurred during
Publishing" message, and the post remains local only.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#5923 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnxUa8SGUUc5lKfUNOI6slNI8tok7nTks5qw1figaJpZM4JvgNs
.

@mattdoble89
Copy link

When I press post, it goes back to the post list as if working, but the post is in Local state, and after five seconds or so the error message appears.

@mattdoble89
Copy link

Are there any further steps we can take?

@SergioEstevao
Copy link
Contributor

I had a look, an it looks that the fix done, sometimes cleans all the
context from the post and then make it fail when we try to upload. I will
continue to investigate to see if I can find the reason behind this.

On Wed, Oct 5, 2016 at 8:45 PM, mattdoble89 notifications@github.com
wrote:

Are there any further steps we can take?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#5923 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnxUfS2Jj8JC5QdPlib-BJuaxRWrkX7ks5qw_5JgaJpZM4JvgNs
.

@mattdoble89
Copy link

OK, Is there a fix you are able to put in place for this? Thanks again for your time! Let me know if we can help.

@aerych
Copy link
Member Author

aerych commented Oct 10, 2016

@SergioEstevao I did some digging into this and I think I've found the issue. I wanted to comment here so @mattdoble89 aware of our progress but I'll share the details on the PR.

@mattdoble89
Copy link

Excited to hear any progress. Can we test?

If the bug is found/fixed, how is the update rolled out?

@aerych aerych modified the milestones: 6.6, 6.5 Oct 11, 2016
@aerych
Copy link
Member Author

aerych commented Oct 11, 2016

@mattdoble89

Can we test?

For sure! Once the patch is updated I'll send you a new link to install a test build of the app.

If the bug is found/fixed, how is the update rolled out?

Assuming we've fixed the bug it should be included in version 6.6 of the app, and available in the app store in a few weeks.

@mattdoble89
Copy link

Brilliant, look forward to hearing something!

@aerych
Copy link
Member Author

aerych commented Oct 17, 2016

@mattdoble89, sorry to keep you waiting. Our patch has been applied to the app and I'm emailing an updated link to install a beta. Hoping it resolves the issue!

@mattdoble89
Copy link

Brilliant, be good to give it a try once you have a link! Any ideas when the update will be applied to app store?

@astralbodies
Copy link
Contributor

@mattdoble89 @aerych Was this one resolved?

@aerych
Copy link
Member Author

aerych commented Feb 6, 2017

@astralbodies No new reports afaik. Let's assume resolved and reopen if needed.

@aerych aerych closed this as completed Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants