-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
'SHARE_DELETED' on getMetadata when using manualSync mode
ieow
commented
May 7, 2024
Can you elaborate the issue ?
why the need to throw on rehydrate failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkIfFactorKeyValid is async function
Can you elaborate the issue ? why the need to throw on rehydrate failed?
Hi, we don't necessarily need to throw rehydration error as when rehydration failed, all the later steps will also fail (factor login, create factor, etc...).
However throwing error on rehydration failed, can catch some errors in early stage and prevent users proceeding to other steps.
Anyway, we have logged out the error message when there's an error during rehydration, so, I think it would be better if we could throw the error also. It will also help us to write better test cases.
Sample case on rehydration failure
- create first core kit with
manualSync:true - create factor (
factorKey1) and don't commit the changes - create second core kit and init (with default params, Mpc-Corekit will rehydrate with existing
factorKey1from sessionManager) - during rehydrate, we try to get the metadata for
factorKey1, but since we don't commit changes in first corekit, factor metadata is not available, resulting in rehydration failure
Uh oh!
There was an error while loading. Please reload this page.
This PR includes -
getFactorKeyMetadataand metadata validation