Page MenuHomePhabricator

Incomplete uploads listing sometimes doesn't show thumbnails
Closed, ResolvedPublic

Description

Every now and then I can pull up the incomplete uploads listing and see that it's missing some thumbnails. Tapping any incomplete uploads correctly shows the image on its detail page.


Version: unspecified
Severity: normal

Details

Reference
bz39717

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:45 AM
bzimport set Reference to bz39717.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 39703 has been marked as a duplicate of this bug. ***

Created attachment 11015
A photo displaying the problem. Ajax loader never finishes and no image picture also seen

Attached:

IMG_20120827_174510.jpg (2×1 px, 1 MB)

Problems with incomplete uploads seen on Nexus S 4.1
Problems with completed uploads seen on Nexus One 2.3.6

Thumbs for complete and incomplete uploads are done very differently, so it may be best to split this into two bugs:

Completed upload thumbnails are loaded via ImageFetcher:

  • first load the thumbnail URLs via an API request
  • then, for each image load it into an offscreen Image object
  • as each image completes loading, resolve() the deferred...
    • caller hides the spinner and loads the thumb URL into an <img/> element in the document, which shows the now-cached thumbnail

Either something's getting lost and not hooked up to the deferred object, or the image is failing to load and the Image's onload event never gets called, so we never resolve the deferred with either a reject or resolve.

A network error breaking the thumbnail load might do this perhaps...

Incomplete upload thumbnails are generated differently, but with some similar elements:

  • load each full-size local image file into an offscreen Image object
  • as each image completes loading, draw it into a <canvas/> element at thumbnail size and replace the spinner image

An actually physically missing image might leave the onload handler not hitting, but .... this ought not happen? Hm. :(

Brion it's worth noting that this bug was raised against the latest beta where both thumbnails were done via ImageFetcher (not latest master)

Thus the problem on incompleted uploads may be gone now.

Ok, let's retest on current code. :)

I can't duplicate this on current code.

https://github.com/wikimedia/WLMMobile/pull/209 may also help with this; I can confirm it fixes the case where thumbnails fail to load due to filename being too long for our Swift storage backend.

So to test this I clicked on uploads and while the logging in message displayed I prepared to turn on airplane mode. I turn it on as thumbnails start to load.

The result is certain images thumbnails display as grey boxes.

I guess this is better than a loader. Possibly we should show a warning triangle in these situations to show something went wrong but I think this is an improvement so closing as fixed. Please open new story to introduce warning triangles.