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

Read key overwritten after device linking immediatly after creating account #529

Open
bgins opened this issue Jun 19, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@bgins
Copy link
Member

bgins commented Jun 19, 2023

Summary

Problem

When a user creates an account and immediately links a second device, their read key is sometimes overwritten.

Impact

Everything will appear to be fine, but on reloading the page the file system will not load with an Error: Could not parse a valid private tree using the given key error. The file system is unusable when this occurs.

Solution

Do not overwrite the read key when we already have one. Overwriting occurs when the user's data root is not available from DNS, and we create a new file system.

Another solution might be to wait longer for a data root to be available from DNS, but there are likely tradeoffs with this approach.

Detail

Describe the bug

The overwrite occurs when the user has created a new account and immediately links a new device. If the linking completes quickly enough, the user's data root CID may no be available from DNS. When this occurs, a new file system is created, overwriting the read key received during device linking.

Told through console logs:

valid-private-key

Expected behavior

The read key should never be overwritten.

If the data root CID can't be resolved, we should throw an error instead of creating an empty file system. Alternatively, we could merge in the actual file system when it becomes available.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Linking between Chrome and Firefox
@bgins bgins added the bug Something isn't working label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant