Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#22656 closed defect (bug) (fixed)

Race conditions in Attachments.more()

Reported by: koopersmith Owned by: ryan
Priority: normal Milestone: 3.5
Component: Media Version: 3.5
Severity: normal Keywords: has-patch
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 6 months ago.
22656.1.to.2.diff (953 bytes) - added by koopersmith 6 months ago.
22656.2.diff (3.6 KB) - added by koopersmith 6 months ago.

Download all attachments as: .zip

Change History (8)

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

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

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

  • 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

In 22957:

Resolve race conditions in Attachments.more().

Props koopersmith
fixes #22656

Note: See TracTickets for help on using tickets.