-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: handle corrupted VSCode auth cache with automatic cleanup and recovery #8131
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
Conversation
✅ Review Complete Code Review Summary |
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.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="extensions/vscode/src/stubs/SecretStorage.ts">
<violation number="1" location="extensions/vscode/src/stubs/SecretStorage.ts:69">
Wrapping decrypt() in a broad try/catch and rethrowing a new Error discards the original stack trace, making future failures much harder to diagnose. Please rethrow the original error (or use ErrorOptions.cause) so callers retain full context.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
// Validate minimum data size to detect corruption early | ||
const minSize = this.saltLength + this.ivLength + this.tagLength; | ||
if (data.length < minSize) { | ||
throw new Error( |
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.
Wrapping decrypt() in a broad try/catch and rethrowing a new Error discards the original stack trace, making future failures much harder to diagnose. Please rethrow the original error (or use ErrorOptions.cause) so callers retain full context.
Prompt for AI agents
Address the following comment on extensions/vscode/src/stubs/SecretStorage.ts at line 69:
<comment>Wrapping decrypt() in a broad try/catch and rethrowing a new Error discards the original stack trace, making future failures much harder to diagnose. Please rethrow the original error (or use ErrorOptions.cause) so callers retain full context.</comment>
<file context>
@@ -59,31 +59,50 @@ export class SecretStorage {
+ // Validate minimum data size to detect corruption early
+ const minSize = this.saltLength + this.ivLength + this.tagLength;
+ if (data.length < minSize) {
+ throw new Error(
+ `Corrupted cache file: insufficient data (${data.length} bytes, expected at least ${minSize})`,
+ );
</file context>
✅ Addressed in 21b987b
21b987b
to
a58149c
Compare
🎉 This PR is included in version 1.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.28.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-review
Checklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Detects and cleans up corrupted VSCode auth cache files so authentication can recover without manual intervention. Addresses Linear CON-4270 by improving error handling for session retrieval and login.