Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 2 years ago

#7487 closed defect (bug) (fixed)

Friends: Drop the number of friends used for priming at-mention suggestions

Reported by: r-a-y Owned by: djpaul
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.2
Component: Friends Keywords:
Cc:

Description

We have set 150 friends as the limit for use with the at-mentions suggestions prime script (see #5950):
https://buddypress.trac.wordpress.org/browser/tags/2.8.2/src/bp-friends/bp-friends-functions.php?marks=785-787#L766

We should probably drop that number even more because the user DB query used to fetch the user data can still be quite large.

eg. SELECT wp_users.ID,wp_users.user_login,wp_users.user_pass,wp_users.user_nicename,wp_users.user_email,wp_users.user_url,wp_users.user_registered,wp_users.user_activation_key,wp_users.user_status,wp_users.display_name FROM wp_users WHERE 1=1 AND wp_users.ID IN ( add 150 user IDs here )

See the following support thread for an example:
https://buddypress.org/support/topic/need-help-troubleshooting-this-error-in-buddypressbp-coreclassesclass-bp-user/

Change History (5)

#1 @tw2113
3 years ago

I think to prevent changing behavior from those who may be expecting 150 users, we could instead provide a filter for those to change as necessary.

#2 @sourfew
3 years ago

Thanks, I followed the support thread and that worked fine.
I can't see how that is related to the limit of 150 and why it works for logged in users.

#3 @DJPaul
2 years ago

  • Milestone changed from Awaiting Review to 3.0

Yes, let's.

#4 @DJPaul
2 years ago

I decided not to filter this because this just controls the range of pre-fetched friends data, used by the at-mentions lookup. It might result for large sites with Friends enabled making more AJAX requests as the user types in a name, but it'll prevent a large slower query on many more sites.

#5 @djpaul
2 years ago

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

In 11693:

Friends: reduce number of pre-fetched friends (of the current user) for the at-mentions JS.

Reduces MySQL query size and time.

Fixes #7487

Note: See TracTickets for help on using tickets.