Opened 6 years ago
Closed 6 years ago
#7726 closed defect (bug) (fixed)
Pending invite cannot be removed from a group when friendship is cancelled
Reported by: | jomisica | Owned by: | dcavins |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 1.7 |
Component: | Groups | Keywords: | has-patch commit |
Cc: | dcavins |
Description
There is a problem with group invitations. I'll explain how.
1 - I create a group
2 - I invite a friend
3 - Cancel the friendship with this friend, without him having accepted the invitation to the group
At this moment the invitation is pending in the group that can not be removed, except for the modification of the tables.
Notification of the invitation to the group is still in the user notification list however if he accepts the invitation he is not placed in the group because the friendship no longer exists.
I discovered this by accidentally canceling a friendship!
Attachments (2)
Change History (16)
#3
@
6 years ago
Very well I recorded the screen when performing the steps.
https://www.ncdc.pt/cache/Send-invites-Screencast-2018-03-28-02:19:56.mp4
The file is too large to send as an attachment, 18MB.
The last step to remove the invitation is that it does not work.
Sorry for my english from google!
#4
@
6 years ago
- Keywords has-patch added; reporter-feedback removed
- Version changed from 2.9.3 to 1.7
Thanks for recording and uploading the video, @jomisica!
For those not viewing the video, here are the steps to duplicate:
- Test on BuddyPress 2.9.3
- User A adds User B as a friend
- User B accepts User A's friendship request
- User A navigates to a group that User B is not a member of
- User A clicks on the group's "Send Invites" tab and invites User B
- User A navigates to their own "Friends" tab and cancels friendship with User B
- User A goes back to the group's "Send Invites" page and User B is still listed in the invites list
- User A attempts to remove User B from the invites list, but cannot
It appears we restrict removing pending group invites to friends in the bp-legacy template AJAX callback. Haven't looked at Nouveau yet, but 01.patch
should fix the issue for 2.9.3.
We should also maybe look to automatically remove pending group invites when a friendship has been withdrawn.
For trunk, there are some issues with the friendship incremented object caching that we added in #7436, which affects testing this ticket. Will update that ticket with some additional info.
#5
@
6 years ago
- Summary changed from Group invitations to Pending invite cannot be removed from a group when friendship is cancelled
#7
@
6 years ago
Hi @r-a-y-
I'm completely in favor of your proposed fix, but it does change the expected behavior by allowing people to invite non-friends to the group as well as being able to uninvite anyone. If this matters to anyone, I'll attach a patch that will keep the "friends" requirement but only apply it to the invitation creation process.
@
6 years ago
Keep "friends" requirement for creating invitations; don't check when canceling an invite
#8
@
6 years ago
Good point, dcavins.
I think removing the friends restriction would allow plugins to do as they please for group invites, which would be a good thing in my eyes.
That being said, I don't have any problems with 02.diff
either.
Anyone else have any thoughts?
#9
@
6 years ago
I think removing the "must be friends to invite to group" check would have significant impact on the UI and existing sites' expectations. We could have that discussion (please do!) but I think to get this bug fixed for 3.0, I think the 2.patch makes a lot of sense and it's elegant, keeping the same behaviour for invites/custom theme templates/etc.
@dcavins @r-a-y any objections? Would be nice to sneak this trunk for 3.0 if we have consensus.
#10
@
6 years ago
I think removing the "must be friends to invite to group" check would have significant impact on the UI and existing sites' expectations.
Sure, but 01.patch
only affects the AJAX call in bp-legacy and not the generation of the invites list.
Let's roll with the patch by @dcavins for now.
I cannot duplicate this with the steps listed above.
Are you using another plugin for invites such as Invite Anyone or something else?
If possible, can you write clearer steps as to how you invited a friend, how you cancelled the friendship request and how you are attempting to accept a group invite?
If taking screenshots or a screencast is easier, that would be great as well.
Unread group invite notifications are always cleared when you visit your
/members/me/groups/invites/
page.The invited user is also able to accept the group invitation. Accepting or rejecting group invites does not rely on a friendship status check.