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

Address failure to completely add project / accept invite #363

Closed
gmaclennan opened this issue Oct 27, 2023 · 0 comments · Fixed by #484
Closed

Address failure to completely add project / accept invite #363

gmaclennan opened this issue Oct 27, 2023 · 0 comments · Fixed by #484

Comments

@gmaclennan
Copy link
Member

gmaclennan commented Oct 27, 2023

Description

As implemented in #362, a project is not added until the auth and config cores have synced. This can result in a situation where the invitor and existing members of the project think that the device is part of the project, but the device itself does not have the project. It's a bit of a chicken-and-egg situation:

  1. The invitor needs to write the capability (authorization) of the invitee to the project before they sync
  2. The invitee needs to sync this capability to be fully connected to the project, but that sync could fail
  3. The invitor has no way of rolling back (e.g. deleting) the capability record because the database is immutable

We could just write another record overriding it, but that could end up with a lot of "useless" capability records if invites repeatedly fail.

An alternative solution, that gives the invited device more opportunity to resolve the situation, is to allow any other device in the project to re-send the invite to the device when they see them:

  1. An invited but not joined device can be identified by other devices in the project because they will appear in the project.members list and in client.listLocalPeers(), but they will not appear in project.$sync.getState() as a connected peer (because they do not have the keys to connect to the project)
  2. Any device that has the relevant encryption keys can send the invite, because the capability record is already written by the invitor.
  3. The invite should be sent automatically by any project member when they see the device.
  4. The invitee will see the invite again whenever they connect to the same wifi as an existing device on the project, and they can accept and complete the join.
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 a pull request may close this issue.

1 participant