Skip to:

Opened 14 years ago

Closed 14 years ago

#2222 closed defect (bug) (fixed)

Double membership bug

Reported by: 3sixty's profile 3sixty Owned by:
Milestone: 1.2.4 Priority: major
Severity: Version:
Component: Groups Keywords: has-patch, needs-testing
Cc: 3sixty, boonebgorges


A member of a private Group somehow has TWO entries for his name in the group's Members list. I asked him how this happened. He wrote back:

"I think you invited me to join. Then when I went to the page, the invitation wasn’t there, so I requested membership. Before you accepted my request, I realized that I could accept your original invitation by following the link from the e-mail. Then you accepted my request to join."

This user is still on the memberlist twice if you want to see the install.

Attachments (1)

prevent_duplicate_memberships.diff (2.8 KB) - added by boonebgorges 14 years ago.

Download all attachments as: .zip

Change History (8)

#1 @3sixty
14 years ago

  • Cc 3sixty added
  • Milestone set to 1.2.4

#2 @3sixty
14 years ago

Also reported more recently in by markshafer

#3 @DJPaul
14 years ago

See the above-linked ticket for further info from another reporter.

#4 @boonebgorges
14 years ago

I've confirmed this bug too.

Right now groups_invite_user checks for duplicate invitations, and groups_send_membership_request checks for duplicate requests, but they don't reference each other at all, which results in two entries in the group members table.

There are a few ways to handle it:
1) Don't let an invite (memb request) be sent if a membership request (invite) already exists. Send an error back to the inviter that says "x has already requested membership" (in the case of invitations) or back to the requester that says "You've already been invited" (in the case of membership requests).
2) When you have both a membership request and an invitation, have the member join the group. The logic: an invitation to join a group is more or less equivalent, at least from a privacy point of view, to the approval of a request. The problem is that it might be a bit confusing to request membership and then all of a sudden find yourself joined. Also, only admins can approve requests, while any group member can send invites - so I guess they're not exactly alike.
3) Allow invites and requests for a user/group pair to coexist, but make sure that the other one is cleared when the invitation is accepted/the notification is approved, so that you don't get the problem of double membership.

I guess (3) seems the most natural to me.

#5 @boonebgorges
14 years ago

  • Keywords has-patch needs-testing added

I wrote a patch that does (3), that is it deletes open requests when an invite is accepted, and deletes open invitations when requests are accepted. I had to do it a bit differently in each direction, please fix if I got it wrong!

#6 @boonebgorges
14 years ago

  • Cc boonebgorges added

#7 @johnjamesjacoby
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2958]) Fixes #2222 props boonebgorges

Note: See TracTickets for help on using tickets.