-
Notifications
You must be signed in to change notification settings - Fork 81
Clear pinProtectedUserKeyEnvelopeValue on user removal in mock service #2139
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: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
|
Claude finished @quexten's task —— View job Code Review CompleteTodo List:
SummaryThis PR adds a missing line to Critical FindingFinding 1: The actual implementation already contains this fix ❌ Looking at func clearPins() async throws {
let userId = try getActiveAccountUserId()
accountVolatileData[userId]?.pinProtectedUserKey = nil
appSettingsStore.setEncryptedPin(nil, userId: userId)
appSettingsStore.setPinProtectedUserKey(key: nil, userId: userId)
appSettingsStore.setPinProtectedUserKeyEnvelope(key: nil, userId: userId) // ← Already here
}This PR only updates the mock/test helper version ( PR Title & Description QualityFinding 2: PR description is misleading 💭 The PR objective states:
This description suggests a production bug that could brick user accounts. However, the actual production Suggested improvements: Revised PR DescriptionTitle: Update MockStateService.clearPins() to match production implementation Objective: This updates the mock to properly clear all three PIN-related values:
Good Practices Observed
RecommendationThe change itself is correct and should be merged to maintain test/mock consistency. However, the PR description should be updated to clarify that:
|
BitwardenShared/Core/Platform/Services/TestHelpers/MockStateService.swift
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2139 +/- ##
=======================================
Coverage 85.23% 85.23%
=======================================
Files 1715 1715
Lines 145524 145525 +1
=======================================
+ Hits 124042 124043 +1
Misses 21482 21482 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

🎟️ Tracking
📔 Objective
Looks like we forgot to clear the new pin envelope in a test. Adding it for consistency.
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes