[buddypress-trac] [BuddyPress Trac] #6978: Friends: Add caching to BP_Friends_Friendship class

buddypress-trac noreply at wordpress.org
Tue Sep 6 23:53:25 UTC 2016

#6978: Friends: Add caching to BP_Friends_Friendship class
 Reporter:  r-a-y                   |       Owner:  dcavins
     Type:  enhancement             |      Status:  accepted
 Priority:  normal                  |   Milestone:  Future Release
Component:  Friends                 |     Version:  1.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
Changes (by dcavins):

 * keywords:  dev-feedback => dev-feedback has-patch
 * owner:   => dcavins
 * status:  new => accepted


 I'm attaching a new patch that follows the more-normal BP pattern:
 • The IDs of the friendship objects are cached for each user.
 • The friendship objects are cached separately, keyed by friendship ID.

 The new patch avoids the use of `wp_list_filter()` and does the list
 filtering inline.

 I've added a couple of tests to verify that the caching is working as
 expected. All other friendship tests are passing.

 I may have uncovered a small bug in
 `BP_Friends_Friendship::delete_all_for_user()`, so I'd like an extra eye
 particularly on my changes to that function. The problem is that the
 function fetches friend IDs via
 `BP_Friends_Friendship::get_friend_user_ids()`, but that function either
 returns confirmed friendships, or requests only, depending on the
 arguments, so I imagine that when users are removed currently, unconfirmed
 friendship records are being left in the database.


Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6978#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list