Skip to content

[PM-33930] fix: Exclude items with invalid keys from TOTP section count#2477

Merged
matt-livefront merged 1 commit intomainfrom
matt/PM-33930-totp-section-count
Mar 24, 2026
Merged

[PM-33930] fix: Exclude items with invalid keys from TOTP section count#2477
matt-livefront merged 1 commit intomainfrom
matt/PM-33930-totp-section-count

Conversation

@matt-livefront
Copy link
Copy Markdown
Collaborator

@matt-livefront matt-livefront commented Mar 23, 2026

🎟️ Tracking

PM-33930

📔 Objective

The "Verification codes" section count on the main vault screen was inflated when a login had a TOTP key set but the key was invalid (e.g. otpauth://totp with no secret).

incrementTOTPCount only checked whether the cipher had a TOTP key and the user had access — it didn't validate that the key could actually produce a code. The list-building path (totpItem(for:)) does attempt code generation and silently drops failures, so the two paths diverged, causing the displayed count to be higher than the number of items shown in the list.

incrementTOTPCount now attempts TOTP code generation (matching the validation already performed by totpItem(for:)) and skips the count increment if generation fails.

📸 Screenshots

Before After
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-23.at.13.52.34.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-23.at.13.57.40.mov

@matt-livefront matt-livefront requested a review from a team as a code owner March 23, 2026 19:12
@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.87%. Comparing base (5a99710) to head (3becda8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2477   +/-   ##
=======================================
  Coverage   86.87%   86.87%           
=======================================
  Files        1846     1846           
  Lines      162969   162985   +16     
=======================================
+ Hits       141572   141589   +17     
+ Misses      21397    21396    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matt-livefront matt-livefront merged commit 398a285 into main Mar 24, 2026
16 of 18 checks passed
@matt-livefront matt-livefront deleted the matt/PM-33930-totp-section-count branch March 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants