Fix encryption service not working on Linux#288
Merged
andrewpareles merged 1 commit intovoideditor:mainfrom Feb 28, 2025
Merged
Fix encryption service not working on Linux#288andrewpareles merged 1 commit intovoideditor:mainfrom
andrewpareles merged 1 commit intovoideditor:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
👍 Looks good to me! Reviewed everything up to a38fc81 in 1 minute and 7 seconds
More details
- Looked at
25lines of code in1files - Skipped
0files when reviewing. - Skipped posting
5drafted comments based on config settings.
1. src/vs/platform/encryption/electron-main/encryptionMainService.ts:26
- Draft comment:
Ensure this fallback to basic encryption on Linux is early enough so that any later logic that relies on the command-line switch uses the updated setting. Modifying command line flags at runtime can sometimes be risky if reads have already occurred. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%
None
2. src/vs/platform/encryption/electron-main/encryptionMainService.ts:7
- Draft comment:
Good addition to import the isLinux flag. Make sure its usage is consistent across the platform checks. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%
None
3. src/vs/platform/encryption/electron-main/encryptionMainService.ts:26
- Draft comment:
Consider using app.commandLine.hasSwitch('password-store') for clarity. Using getSwitchValue and checking for falsy value works, but hasSwitch more clearly expresses the intent of checking presence of a switch. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%
None
4. src/vs/platform/encryption/electron-main/encryptionMainService.ts:28
- Draft comment:
Modifying command line arguments during service construction can lead to unexpected side effects if other modules expect the original state. Consider moving this configuration to an earlier initialization phase. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
While modifying command line args during runtime can be risky, this seems to be an initialization-time configuration that needs to happen before encryption settings are applied. The modification is guarded by platform check and only happens if the switch isn't already set. The value is used immediately after, suggesting tight coupling between setting and using the switch. Moving this elsewhere could actually make the code more complex.
The comment raises a valid concern about command line argument modification timing. Other services could potentially read this switch before this service is constructed.
However, this appears to be encryption-specific initialization that needs to happen before encryption settings are configured. The tight coupling and immediate usage suggests this is the appropriate place for this code.
The comment raises a theoretical concern but the current implementation appears reasonable and moving it could add unnecessary complexity. The comment should be removed.
5. src/vs/platform/encryption/electron-main/encryptionMainService.ts:26
- Draft comment:
Add an inline comment explaining why the basic encryption fallback is enforced on Linux if no 'password-store' switch is provided, to aid future maintainers. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%
None
Workflow ID: wflow_Ew51JvxhMMJZCYXQ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
Contributor
|
This looks good, but I want to make sure there wasn't a reason Linux was left off here by VSCode. Will check back once rebase is complete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes API keys not storing and providers not working on Linux:
To fix this, if the user does not provide a default text encryption option, the system will default to the basic encryption method, preventing the error.
Important
Fixes encryption on Linux by defaulting to basic encryption in
EncryptionMainServicewhen nopassword-storeis specified.password-storeis specified inEncryptionMainService.encryptionMainService.tsto handle Linux-specific encryption behavior.This description was created by
for a38fc81. It will automatically update as commits are pushed.