Skip to content

[BWA-253] bug: Filtering empty otp uris sent by Password Manager app#6869

Merged
aj-rosado merged 2 commits into
mainfrom
BWA-253/not-displaying-totp-coded-with-empty-key
May 6, 2026
Merged

[BWA-253] bug: Filtering empty otp uris sent by Password Manager app#6869
aj-rosado merged 2 commits into
mainfrom
BWA-253/not-displaying-totp-coded-with-empty-key

Conversation

@aj-rosado
Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/BWA-253

📔 Objective

Authenticator app should not display TOTP items that have an empty uri/key. This aims to filter the empty ones out

@aj-rosado aj-rosado requested review from a team and david-livefront as code owners May 4, 2026 17:41
@aj-rosado aj-rosado added the ai-review Request a Claude code review label May 4, 2026
@aj-rosado aj-rosado changed the title [BWA-253] Filtering empty otp uris sent by Password Manager app [BWA-253] bug: Filtering empty otp uris sent by Password Manager app May 4, 2026
@github-actions github-actions Bot added app:authenticator Bitwarden Authenticator app context t:bug Change Type - Bug labels May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a focused bug fix that filters out shared authenticator items with empty otpUri values received from the Password Manager app before passing them to TotpCodeManager.getTotpCodesFlow. The filter is correctly scoped to the AccountSyncState.Success branch in AuthenticatorRepositoryImpl.toSharedVerificationCodesStateFlow, since locally-sourced items always produce a non-empty URI via toOtpAuthUriString(). Test coverage adds a dedicated case verifying filtering behavior with a verify(exactly = 1) assertion on the filtered list, addressing the existing reviewer feedback, and updates the prior Success emission test to use a real empty list (required because the new code path now invokes .filter on the list).

Code Review Details

No findings.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.55%. Comparing base (8223fb3) to head (1d64e70).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6869      +/-   ##
==========================================
- Coverage   85.55%   85.55%   -0.01%     
==========================================
  Files         840      971     +131     
  Lines       59753    62353    +2600     
  Branches     8720     8829     +109     
==========================================
+ Hits        51124    53345    +2221     
- Misses       5631     5965     +334     
- Partials     2998     3043      +45     
Flag Coverage Δ
app-data 17.83% <0.00%> (+0.23%) ⬆️
app-ui-auth-tools 20.43% <0.00%> (+0.38%) ⬆️
app-ui-platform 16.47% <0.00%> (+0.68%) ⬆️
app-ui-vault 26.25% <0.00%> (+0.56%) ⬆️
authenticator 6.60% <100.00%> (+0.03%) ⬆️
lib-core-network-bridge 4.07% <0.00%> (-0.20%) ⬇️
lib-data-ui 0.97% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

SharedVerificationCodesState.Success(verificationCodes),
awaitItem(),
)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a verify block here to prove that the items were in fact filtered.

verify(exactly = 1) {
    mockTotpCodeManager.getTotpCodesFlow(filteredItems)
}

@aj-rosado aj-rosado added this pull request to the merge queue May 6, 2026
@aj-rosado
Copy link
Copy Markdown
Contributor Author

Thanks @david-livefront 🎉

Merged via the queue into main with commit a53260f May 6, 2026
25 checks passed
@aj-rosado aj-rosado deleted the BWA-253/not-displaying-totp-coded-with-empty-key branch May 6, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:authenticator Bitwarden Authenticator app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants