[wp-trac] [WordPress Trac] #24859: Media Library does not have a loading indicator

WordPress Trac noreply at wordpress.org
Mon Mar 17 12:27:23 UTC 2014


#24859: Media Library does not have a loading indicator
----------------------------+-----------------------------
 Reporter:  jeffr0          |       Owner:  wonderboymusic
     Type:  task (blessed)  |      Status:  reopened
 Priority:  normal          |   Milestone:  3.9
Component:  Media           |     Version:  3.5
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  javascript
----------------------------+-----------------------------
Changes (by kovshenin):

 * keywords:  has-patch commit => has-patch


Comment:

 Looked into this again. There is indeed a simple case, where a promised
 deferred never gets resolved or rejected. It happens when a second .more()
 is fired which changes the collection being mirrored. It's usually not a
 problem, because the newer call to .more() also watches the new promise
 and hides the spinner on done().

 However, if that newer call results in a cached query with a non-empty
 result, our code to hide the spinner in AttachmentsBrowser.updateContent()
 never kicks in. It's pretty easy to reproduce and easier if you add
 `sleep(3)` to admin-ajax.php: try searching for something and erasing your
 search before it finished loading. Quickly toggling between filters (All -
 Images - All) has the same effect.

 In [attachment:24859.15.diff]: hide the spinner if `updateContent` was
 called with a non-empty collection.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24859#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list