Could not parse a valid private tree using the given key
The file system data root may not be available immediately after linking completes. This issue is documented in https://github.com/oddsdk/ts-odd/issues/529. When this issue occurs, the result is a Error: Could not parse a valid private tree using the given key, but only after a reload.
The fix for this issue is waiting in the account linking consumer until the data root is available (when it is a non-empty CID).
Type of change
[x] Bug fix (non-breaking change that fixes an issue)
Testing
Create a new account and link it on a second device immediately and as quickly as possible. No errors should occur and the file system should load and work as expected.
Description
This PR fixes account linking bugs.
Failed to fetch root DID
The account linking consumer is initialized a second time after account linking. It seems the
link-device
page is loaded a second time.The fix here is guarding the initialization call when we have a session, which prevents the account linking consumer from starting unnecessarily.
https://github.com/oddsdk/odd-app-template/blob/435a235ae68c9fa01df4f176c93b427c2253718f/src/routes/link-device/%2Bpage.svelte#L58-L60
Could not parse a valid private tree using the given key
The file system data root may not be available immediately after linking completes. This issue is documented in https://github.com/oddsdk/ts-odd/issues/529. When this issue occurs, the result is a
Error: Could not parse a valid private tree using the given key
, but only after a reload.The fix for this issue is waiting in the account linking consumer until the data root is available (when it is a non-empty CID).
Type of change
Testing
Create a new account and link it on a second device immediately and as quickly as possible. No errors should occur and the file system should load and work as expected.