Wp-calypso: Media: on Jetpack site uploading multiple images at once causes images to be added out of order to library

Created on 3 Feb 2017  路  10Comments  路  Source: Automattic/wp-calypso

Reported by @m with Calypso staging environment.

Steps to reproduce

  1. Starting at Media https://wordpress.com/media/example.com for a Jetpack site
  2. Upload a batch of images
  3. Notice they displace existing images in the upload order

What I expected

For uploaded photos to appear in order during upload, and not move around or be placed after previously uploaded photos.

What happened instead

I dragged and dropped about 30 photos onto calypso staging, going to ma.tt
They appeared in the media library in essentially random order, intermixed with previous uploads
and they're moving around as the upload completes

Browser / OS version

Mac-n-Chrome

Screenshot / Video

sooedgc7yz-3000x3000

Context / Source

Found via #dogfooding / #manual-testing

Media [Type] Bug

Most helpful comment

@gwwar It's possible it's fixed now based on above comments. I haven't been able to reproduce it either.

I can look again, and also ask Flow Patrol to hammer it a bit in some stress testing.

All 10 comments

I've following different issues/PRs trying to understand what should be the correct behavior here.

Are we agree with that it should be something like the follwing?

order

It was fixed for .com sites in this issue: https://github.com/Automattic/wp-calypso/pull/3577.

Do you know @aduth what could be the difference here between Jetpack and .com sites?

Personally, I couldn't reproduce this issue for Jetpack sites.

Yes, this should have been fixed with #3577, regardless of Jetpack or not. The MediaActions.add function has seem some changes since then with consideration for image editor. Are we treating Jetpack sites any differently for uploads with the addition of the new v1.2 media endpoints?

Are we agree with that it should be something like the follwing?

Yes, the easiest way to preserve ordering I found was to simply upload in series, one after another.

Are we treating Jetpack sites any differently for uploads with the addition of the new v1.2 media endpoints?

Not at all because we aren't using edit-media endpoint only when a media is _"edited"_. For this reason, the endpoint expects a mediaID in its path. It will return a 404 if not.

Also, I've taken a screenshot just to be sure:
image
We still, and make sense, using the new-media endpoint.

@lancewillett were there any other steps needed to reproduce this? I'm having a hard time getting into that state. Anything special about file age or filename?

@gwwar It's possible it's fixed now based on above comments. I haven't been able to reproduce it either.

I can look again, and also ask Flow Patrol to hammer it a bit in some stress testing.

I tested this on my Jetpack site and the uploads and gallery were in correct order. The gallery shortcode looked like:

[gallery ids="18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39"]

@lancewillett and @alisterscott for the test. This seems to have been fixed.
Are we ok to close this one?

Yes, let's re-open if it happens again.

Tested & confirmed fixed. 51s

Was this page helpful?
0 / 5 - 0 ratings