[buddypress-trac] [BuddyPress Trac] #9000: Group member object cache not refreshed after removal

buddypress-trac noreply at wordpress.org
Thu Oct 5 17:16:29 UTC 2023


#9000: Group member object cache not refreshed after removal
--------------------------+-----------------------------
 Reporter:  iandunn       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Groups        |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If you're using memcached and remove a member from a group, the
 corresponding cached value isn't cleared in all of the places where it's
 fetched.

 == Environment setup
 1. Core `trunk` @ `89da2ff3a9`
 1. BuddyPress `11.3.1`
 1. [https://wordpress.org/plugins/memcached/ memcached] plugin. No other
 plugins active.
 1. twentytwentythree theme
 1. memcached server
 1. memcache (no `d`) PHP extension
 1. Create a group with ID `1`
 1. Create a user with ID `2`

 == Reproduce bug
 1. `wp bp group member list 1`. Only shows user `1`. User `2` is not
 listed
 1. `wp bp group list --user-id=2`. Shows no memberships

 1. `wp bp group member add --group-id=1 --user-id=2`. Shows success
 1. `wp bp group list --user-id=2`. Shows the membership is assigned
 1. `wp bp group member list 1`. User `2` is listed

 1. `wp bp group member remove --group-id=1 --user-id=2`. Shows success.
 1. `wp bp group member list 1`. User `2` not listed
 1. `wp bp group list --user-id=2`

 `group member list` is correct, but `group list --user-id` still has the
 cached value from before the removal. If you check the
 `wp_bp_groups_members` table, you'll see that the membership was removed.

 1. Run `flush_all` in memcached telnet
 1. `wp bp group list --user-id=2`

 Now it correctly shows no memberships.

 If you disable the memcached plugin and repeat steps, you'll get the
 correct results. So the bug is limited to memcached.

 I encountered this when
 [https://github.com/WordPress/wordcamp.org/pull/964 debugging some web
 code], so it's not limited to the WP-CLI commands, I just used those above
 to make reproduction simpler.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9000>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list