Fix Leave Group endpoint#35
Conversation
|
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? |
|
@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:
|
|
@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)? ScenarioPerson A invites B, C, D. Scenario 1: Person C leaves. Scenario 2: Person B leaves. AnalysisIn 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
|
In Scenario 1, the group should not be disbanded because B is still a member and there are invited members. I think, in general, a group should be disbanded in the following scenarios: a. Members = [A, B], Invited = []; 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. |
|
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] |
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
left a comment
There was a problem hiding this comment.
Tests are failing 😭
|
@zineanteoh is this PR still relevant? |
Don't delete group when group still has invited membersDiscuss this first before merging (we might or might not want this feature)