[buddypress-trac] [BuddyPress Trac] #6210: Create New Invitations API

buddypress-trac noreply at wordpress.org
Tue Mar 19 20:17:57 UTC 2019

#6210: Create New Invitations API
 Reporter:  dcavins                      |       Owner:  dcavins
     Type:  enhancement                  |      Status:  reopened
 Priority:  low                          |   Milestone:
Component:  Core                         |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  dev-feedback trac-tidy-2018  |

Comment (by dcavins):

 Thanks for your feedback on the changes to `bp_get_user_groups()`. I'm
 attaching an alternative logic branch that I had abandoned but was able to
 simplify after reading your initial feedback, which was very helpful. I'll
 also attach another complete patch, including the alternative logic in

 There is one other wrinkle between the new invitations logic and
 `bp_get_user_groups()`. `bp_get_user_groups()` formats the response as an
 array, keyed by the group ID. However, it's possible to have more than one
 entry per group, so the results may not be 100% accurate. In current BP, I
 think it would be possible for an unsent invitation and a later request to
 the same group to exist, so the last record encountered would set the
 status for the user in that group. In both cases, the user is not
 confirmed, but determining status between "pending" and "invited" from
 `bp_get_user_groups()` could be incorrect.

 In the new invitations scheme, multiple users are allowed to extend an
 invitation to the same user, so it would be conceivable, if an unsent
 invitation is the last record encountered, the user may not seem invited,
 though an earlier record was a sent invitation.

 Because I've altered `groups_is_user_invited()`, which used to rely on
 `bp_get_user_groups()` to determine the status, the chance for error is
 minimized, but there is a slim chance that if devs are currently using
 `bp_get_user_groups()` to fetch invitations, they could run into the
 occasional problem.

 This key conflict just occurred to me while updating the patch. I hope my
 explanation makes sense.


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

More information about the buddypress-trac mailing list