-
Notifications
You must be signed in to change notification settings - Fork 24
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
Data root missing when linking a second device #420
Comments
I was also looking at this error message earlier today, we're actually calling // No DNS CID yet
cid = await cidLog.newest()
cid = cid ? decodeCID(cid) : null |
I should also point out that if the That said, we could reuse |
Yep, agreed. 💯
Would we want to poll the data root instead of the root DID? We are checking the data root in the workaround in the Webnative app template. Would root DID also work? |
Sorry should've been more clear. I meant reusing the retry mechanism of that function, we can easily swap out the DID lookup with the data root lookup. |
Yep, I think this is the right way to go. I'll implement it and put in a PR with it. 👌 |
Summary
Problem
When a user links their account on a second device immediately after registering, the data root for their filesystem might not be available.
Impact
The linked device may not be able to load the filesystem right away. The linked device will need to poll until the data root is available.
Solution
One possibility would be moving the necessary polling into the account linking code. This option is not ideal because we should keep the account linking code decoupled from filesystem concerns.
Another possibility would be to move the polling into
loadFilesystem
: https://github.com/fission-codes/webnative/blob/01b57e2d6616631b2b4a484a46fd14e385aa8a0b/src/filesystem.ts#L35-L103Detail
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Could not decode CID: undefined
error will appear in the consoleExpected behavior
The filesystem should load without throwing an exception.
Screenshots
The decode CID exception looks like
Note that the exception is not a direct representation of the missing data root. It occurs because no data root exists and we instead look for a root CID in the CID log, which does not exist yet.
Desktop (please complete the following information):
Additional context
The Webnative app template works around this issue by polling the data root: https://github.com/fission-codes/webnative-app-template/blob/05b70fd1596c89204a45a54f4eef81aed45c41ba/src/lib/common/webnative.ts#L126-L149
The text was updated successfully, but these errors were encountered: