Skip to content

Fix Leave Group endpoint#35

Draft
zineanteoh wants to merge 3 commits into
mainfrom
fix-leave-group
Draft

Fix Leave Group endpoint#35
zineanteoh wants to merge 3 commits into
mainfrom
fix-leave-group

Conversation

@zineanteoh

@zineanteoh zineanteoh commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

Don't delete group when group still has invited members

Discuss this first before merging (we might or might not want this feature)

@zineanteoh zineanteoh requested a review from jacoblurie29 April 18, 2023 06:39
@zineanteoh

Copy link
Copy Markdown
Contributor Author

Actually upon thinking about this a bit more, what is the expected behavior we want?

You create a group and invite a bunch of friends. You leave the group. Should the group be disbanded?

@jacoblurie29

jacoblurie29 commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

@zineanteoh This is an interesting scenario. Say person A invites person B, C, and D. Person A leaves the group. Does the group disband? I see three options:

  1. Don't allow user A to leave group, only allow them to delete it if they are the only member (I don't like this)
  2. Allow user A to leave group and have a member-less group exist with only B, C, and D invites (ehhh I don't know about this)
  3. Allow user A to leave group but notify user A that since they are the only person in the group, it will now be deleted and the invites to B, C, and D will be rescinded

@zineanteoh

zineanteoh commented Apr 18, 2023

Copy link
Copy Markdown
Contributor Author

@jacoblurie29 Ah, that’s clever. I like option 3 better, and you bring up a good point of notifying the other users about it being disbanded.

Do you think the same holds true for other scenarios too (trying to push our idea to the extreme here)?

Scenario

Person A invites B, C, D.
Person B accepts invitation.
Person C accepts invitation.
Now members = [A,B,C], invited = [D]
Person A leaves.
Person B invites E, F.
Now members = [B,C], invited = [D,E,F]

Scenario 1: Person C leaves.
Should the group be disbanded?

Scenario 2: Person B leaves.
Should the group be disbanded?

Analysis

In scenario 1, B is left in the group but there still exist members invited by B to the group. So technically the group shouldn’t disband? (similar to creating a new group)

In scenario 2, C is left in the group but none of the invited members were invited by C.

Another option

  1. in the event of a user leaving a group with 2 or less existing members, they could be prompted to choose between “Leave without disbanding” or “Disband group”? Would this work?

@ethanratnofsky

ethanratnofsky commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

Scenario 1: Person C leaves. Should the group be disbanded?

Scenario 2: Person B leaves. Should the group be disbanded?

In Scenario 1, the group should not be disbanded because B is still a member and there are invited members.
In Scenario 2, the group should be disbanded because there are no real members left (even though there are invited members).

I think, in general, a group should be disbanded in the following scenarios:

a. Members = [A, B], Invited = []; B leaves.
b. Members = [A], Invited = [B, C, D]; A leaves.
c. Members = [A], Invited = [B]; B leaves.

Alternatively, we can allow a group of size 1 to exist in any case, but if they invite someone and then leave, it would be disbanded. For example, the group should be disbanded in the following scenario:

Members = [A], Invited = [B]; A leaves.

@zineanteoh

Copy link
Copy Markdown
Contributor Author

@ethanratnofsky

Oops, minor catch: I meant to write scenario 1 and scenario 2 as two separate events, rather than 2 happening after 1.

So scenario 2 should have members = [B], invited = [D,E,F]

@ethanratnofsky

Copy link
Copy Markdown
Contributor

So scenario 2 should have members = [B], invited = [D,E,F]

Oh, yeah okay, then I would say the group should not be disbanded because C is still in the group.

I would say we should base these on what happens in other apps. For example, what happens when the creator leaves their iMessage/WhatsApp/WeChat/Instagram/Snapchat group chat? It's a bit different for us because users have to accept group invites.

@jacoblurie29 jacoblurie29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing 😭

@jacoblurie29

Copy link
Copy Markdown
Contributor

@zineanteoh is this PR still relevant?

@jacoblurie29 jacoblurie29 marked this pull request as draft July 4, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants