Make WordPress Core

Opened 8 years ago

Last modified 4 years ago

#38782 reviewing defect (bug)

Insert/Edit link scrolling triggers AJAX requests for both (recent and search) rivers

Reported by: davidbinda's profile david.binda Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Future Release Priority: normal
Severity: normal Version: 4.6.1
Component: Editor Keywords:
Focuses: ui, performance Cc:

Description

I noticed quite a number of insert/edit link related SQL queries. When testing the feature, I have noticed that in case a search keywords is typed into the search field and user scrolls down the results, not only the search river related AJAX is made, but also a recent river triggers an AJAX request.

The behaviour currently looks this way:

1) opening the Insert/Edit link modal triggers following AJAX request:

action: wp-link-ajax
page: 1

2) putting in a keyword to search input triggers following AJAX request:

action: wp-link-ajax
page: 1
search: {keyword}

3) scrolling down the results of the search query produces two AJAX request:

action: wp-link-ajax
page: 2

and

action: wp-link-ajax
page: 2
search: {keyword}

4) as the search AJAX for page 2 returned false, scrolling up produces following AJAX only:

action: wp-link-ajax
page: 3

5) removing the keyword form the search input user is taken to the recent river which now already contains 4 pages of results

Since this behaviour is producing a lot of SQL queries with an increasing offset, those queries are getting slow with increasing dataset. Shouldn't the implementation be triggering AJAX requests for visible river only?

Attachments (2)

38782.patch (469 bytes) - added by david.binda 8 years ago.
Patch for querying results for visible river only
38782.diff (619 bytes) - added by dinhtungdu 5 years ago.
Prevent loading for hidden river.

Download all attachments as: .zip

Change History (5)

@david.binda
8 years ago

Patch for querying results for visible river only

This ticket was mentioned in Slack in #core by noisysocks. View the logs.


5 years ago

#2 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

@dinhtungdu
5 years ago

Prevent loading for hidden river.

#3 @audrasjb
4 years ago

  • Milestone changed from 5.4 to Future Release

Hi,

With 5.4 Beta 3 approaching and the Beta period reserved for bugs introduced during the cycle, this is being moved to Future Release. If any maintainer or committer feels this should be included or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

Note: See TracTickets for help on using tickets.