auth icon indicating copy to clipboard operation
auth copied to clipboard

Check to see if this membership resolution error is still possible

Open HerbCaudill opened this issue 2 years ago â€Ē 0 comments

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

HerbCaudill avatar Nov 19 '23 15:11 HerbCaudill