Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22656 closed defect (bug) (fixed)

Race conditions in Attachments.more()

Reported by: koopersmith's profile koopersmith Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch
Focuses: Cc:

Description

When a collection of attachments fires off a request for more attachments, it will pass the request along to its mirrored query and return the resulting request. The query caches its own request, but the main attachments group doesn't check to see if that same query is still being mirrored when the request resolves. This results in a race condition where we quickly switch mirrored queries and can fire off several requests within a short time span.

A good way to test this is to go to the media library and type into the search box quickly — you'll end up seeing duplicate views. The patch should result in one consistent view.

Attachments (3)

22656.diff (2.9 KB) - added by koopersmith 11 years ago.
22656.1.to.2.diff (953 bytes) - added by koopersmith 11 years ago.
22656.2.diff (3.6 KB) - added by koopersmith 11 years ago.

Download all attachments as: .zip

Change History (8)

@koopersmith
11 years ago

#1 @koopersmith
11 years ago

Patch also adds Attachments.hasMore() and prevents the infinite scroll scanner from perpetually checking for new attachments when all of them had already loaded.

#2 @ocean90
11 years ago

It's less with the patch but still exists: http://cl.ly/LGTJ.

#3 @koopersmith
11 years ago

Latest also fixes a race condition in the attachments browser view by making it properly clean up its content components.

#4 @ryan
11 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 22956:

Resolve race conditions in Attachments.more(). Provides for smoother refreshes when searching and properly cleans out content components.

Props koopersmith
fixes #22656

@koopersmith
11 years ago

#5 @ryan
11 years ago

In 22957:

Resolve race conditions in Attachments.more().

Props koopersmith
fixes #22656

Note: See TracTickets for help on using tickets.