Opened 8 years ago
Closed 8 years ago
#7487 closed defect (bug) (fixed)
Friends: Drop the number of friends used for priming at-mention suggestions
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
#2
@
8 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.
#4
@
8 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.
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.