-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Mobile,Desktop: Resolves #10856: Allow disabling master keys to improve startup performance #10943
Conversation
…isabled master keys, allow disabling master keys on mobile
packages/app-mobile/root.tsx
Outdated
| // Like the desktop and CLI apps, we run this whenever the sync target properties change. | ||
| // Previously, this only ran when encryption was enabled/disabled. However, after fetching | ||
| // a new key, this needs to run. | ||
| if ((action.type === 'SETTING_UPDATE_ONE' && action.key === 'syncInfoCache') || (action.type === 'SETTING_UPDATE_ALL')) { |
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.
Note: Similar logic in BaseApplication.ts had a similar change applied in 2021.
|
Converting to a draft — there seem to be issues with "invalid password" errors in some cases. |
|
The issue seems unrelated to this pull request. Instead, it seems to be caused by setting the same password for both the active master key (key A, correct password) and a secondary master key (key B, incorrect password). As such, I'm marking this pull request as ready for review. A fix for this issue, which I plan to include in a separate pull request, can be found here. |
|
The logic for disabled master keys is that they can't be used for encryption, and they are hidden in the list of keys. However it should still be possible to use them for decrypting data. For example if the user disable a key, then sync, and some of the notes were encrypted with this now disabled key, it should still be used for decryption. I'm wondering if with this change this would still happen? |
Thank you for noticing this! No, it wouldn't happen with this change. A possible alternative could be to store whether a key has an incorrect password and, if so, skip trying to decrypt it on startup. This has the advantage of not changing how disabled keys affect sync. If users have a large number of master keys with invalid passwords, this would improve startup performance (for me, 5 of my 6 master keys are unused and have incorrect passwords). |
|
See #10990 |
Summary
This pull request:
Note
The encryption config screen with many master keys may still be very slow (
usePasswordCheckerseems to check passwords for both enabled and disabled keys). A possible fix can be found here.Screenshot
Testing plan
Web:
The above steps were last done on this commit which is not the latest in this pull request.
Desktop:
Android 13: