Skip to content

Conversation

LRNcardozoWDF
Copy link
Member

@LRNcardozoWDF LRNcardozoWDF commented Sep 22, 2025

🎟️ Tracking

PM-11707

📔 Objective

Fix a bug where editing an item from the search results list wouldn't update it in the list. The view now subscribes to the search results instead of using a static list.

For the Authenticator, instead of repeating the search we we subscribed the view to search results.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 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

Copy link
Contributor

github-actions bot commented Sep 22, 2025

Logo
Checkmarx One – Scan Summary & Detailsebdbc4d9-e10a-4421-aef3-09163d0c55e7

Great job! No new security vulnerabilities introduced in this pull request

Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 95.37037% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.01%. Comparing base (277efe6) to head (5c826d3).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...ult/Repositories/AuthenticatorItemRepository.swift 25.00% 3 Missing ⚠️
...UI/Vault/ItemList/ItemList/ItemListProcessor.swift 95.34% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1966       +/-   ##
===========================================
- Coverage   81.32%   49.01%   -32.32%     
===========================================
  Files         832      291      -541     
  Lines       52457    12821    -39636     
===========================================
- Hits        42663     6284    -36379     
+ Misses       9794     6537     -3257     

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

@LRNcardozoWDF LRNcardozoWDF marked this pull request as draft September 22, 2025 16:15
@LRNcardozoWDF LRNcardozoWDF marked this pull request as ready for review September 22, 2025 16:19
Copy link
Member

@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

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

Looks good overall, but aside from the improvements in the comments, several tests are missing for the new code.

/// Refreshes TOTP Codes for the search results.
///
private func refreshTOTPCodes(searchItems: [ItemListItem]) async {
guard case let .data(currentSections) = state.loadingState else { return }
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Do you need this guard for the search items?

Comment on lines 230 to 234
let refreshedItems = try await services.authenticatorItemRepository.refreshTotpCodes(on: searchItems)
let updatedSections = currentSections.updated(with: refreshedItems)
let allItems = updatedSections.flatMap(\.items)
searchTotpExpirationManager?.configureTOTPRefreshScheduling(for: allItems)
state.searchResults = updatedSections[0].items
Copy link
Member

Choose a reason for hiding this comment

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

🤔 You could use a similar approach as in here to reduce code duplication even though you can't use the same as the item objects and repository are different. However, you could try to centralize them by converting the protocol to a more generic one with additional generic protocols for the repositories; therefore you can have something like HasTOTPCodesSection<ItemListItem> conformance here and move the utility to BitwardenKit to be shared between the apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants