-
Couldn't load subscription status.
- Fork 10
Fix/disableHashedFactorkey #223
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
base: rc/v3.5.0
Are you sure you want to change the base?
Conversation
src/mpcCoreKit.ts
Outdated
| if (this.sessionId) { | ||
| const payload: SessionData = { | ||
| postBoxKey: this.state.postBoxKey, | ||
| postboxKeyNodeIndexes: this.state.postboxKeyNodeIndexes || [], | ||
| factorKey: this.state.factorKey?.toString("hex"), | ||
| tssShareIndex: this.state.tssShareIndex as number, | ||
| tssPubKey: this.state.tssPubKey?.toString("hex"), | ||
| signatures: this.signatures, | ||
| userInfo: this.state.userInfo, | ||
| }; | ||
| this.sessionManager.updateSession(payload); | ||
| } |
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.
@arch1995 should double check this. I'm not familiar with sessionManager.
| shareDescription: FactorKeyTypeShareDescription.Other, | ||
| updateMetadata: false, | ||
| }); | ||
| await this.setDeviceFactor(factorKey); |
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.
So this means the factor key was previously not persisted here, which is kind of catastrophic. We should have a test that asserts this.
| ]; | ||
|
|
||
| const email = "testmail99"; | ||
| const email = "testmail99-1"; |
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.
Why that change? (We briefly talked about it in our call, but I think it would be good to document it here.)
| await coreKitInstance.tKey.storageLayer.setMetadata({ | ||
| privKey: new BN(coreKitInstance.state.postBoxKey!, "hex"), | ||
| input: { message: "KEY_NOT_FOUND" }, | ||
| }); |
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.
Why we no longer delete key on setup?
|
|
||
| const { idToken, parsedToken } = login ? await login(email) : await mockLogin(email); | ||
| await instance.init(); | ||
| await instance.init({ handleRedirectResult: false, rehydrate: false }); |
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.
What are the default values for these parameters? Did we change these? If so, why? Or are we just being more explicit here?
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.
approved changes related to session manager
Motivation and Context
Jira Link:
Description
Fix feature disableHashedFactorkey
device factorkey is not set when disableHashedFactoryKey flag is set.
this is causing user lose the device factorkey during signup.
update session on commit
Session data is not updated when commits happens,
If user close and reopen the app this will cause user rehydrate( if rehydration is enabled) with old factorkey / metadata. This is causing the instance not consistent
update tests
update tests cases
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist: