Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check to see if this membership resolution error is still possible #75

Open
HerbCaudill opened this issue Nov 19, 2023 · 0 comments
Open

Comments

@HerbCaudill
Copy link
Member

This is from a comment in membershipResolver.test.ts:

sometimes (50% of the time?) when we eliminate duplicate ADD_MEMBERs,we're eliminating one that would have needed to have come BEFORE something else, in this case the CHANGE_MEMBER_KEYs action that happens after that person is admitted. Here's an example of a bad graph that you can end up with that way:

👩🏾 ROOT
ADD_MEMBER:👨‍🦲
                                                          <== ADD_MEMBER:👳🏽‍♂️ was removed from here
INVITE:kPFx4gwGpuWplwa
INVITE:tiKXBLLdMbDndJE
ADMIT:👳🏽‍♂️
CHANGE_MEMBER_KEYS:{"type":"MEMBER","name":"👳🏽‍♂️",...}    <== we can't do this because 👳🏽‍♂️ hasn't been added yet
ADD_DEVICE:👳🏽‍♂️:laptop
ADD_MEMBER:👳🏽‍♂️
INVITE:dQRE52A+7UGr8X9
ADD_MEMBER:👴
INVITE:j6cC8ZyjyhuojZw
ADMIT:👴
CHANGE_MEMBER_KEYS:{"type":"MEMBER","name":"👴",...}
ADD_DEVICE:👴:laptop

Here's how that graph should have been resolved:

👩🏾 ROOT
ADD_MEMBER:👨‍🦲
ADD_MEMBER:👳🏽‍♂️                                             <== in the bad graph,this ADD_MEMBER was discarded as a duplicate
INVITE:fNpSg0uBcW1vYvf
ADD_MEMBER:👴
INVITE:PkD7SISvUt/3YlJ
ADMIT:👳🏽‍♂️
CHANGE_MEMBER_KEYS:{"type":"MEMBER","name":"👳🏽‍♂️",...}
ADD_DEVICE:👳🏽‍♂️:laptop
                                                          <== ADD_MEMBER:👳🏽‍♂️ was removed from here
INVITE:Pu6NaY6HfbITAf6
INVITE:7vVS0NXz+u15Mx2
ADMIT:👴
CHANGE_MEMBER_KEYS:{"type":"MEMBER","name":"👴",...}
ADD_DEVICE:👴:laptop
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

No branches or pull requests

1 participant