-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Add support for device dehydration v2 (Element R) #4062
Conversation
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.
LGTM other than a few suggestions which may or may not be helpful
I've been thinking about this a bit more, and it's continuing to nag at me. In particular: we already have a bit of a mess with APIs like I'm really worried that we're compounding this situation by adding a bunch more methods that the application is supposed to call at some ill-defined time during startup. For example:
A couple of things on this:
|
src/crypto-api.ts
Outdated
* If the delay is omitted or 0, this function's promise will resolve after | ||
* the first dehydrated device is created. |
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.
* If the delay is omitted or 0, this function's promise will resolve after | |
* the first dehydrated device is created. | |
* If the delay is omitted or 0, this function's promise will resolve after | |
* the first dehydrated device is created. Otherwise, it resolves immediately. |
Having thought a bit more about this, I don't think it's critical that we need to store that information. If we replace the dehydrated device early, nothing bad will happen, so on restart, we can just create a new dehydrated device right away, and continue from there with the normal scheduling. So I can change the Regarding the larger API concerns, I'll give it some thought, about whether I can throw things into |
I've implemented a simpler API. Now, clients just need to check if dehydration is available, and then tell it to start dehydration, and it'll do everything necessary. Clients can re-start dehydration if it, e.g. needs to create a new dehydration key when it resets secret storage. |
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.
Excellent, this seems better! Still a couple of concerns.
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.
LGTM!
No description provided.