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 & Details575a3b9c-252e-436b-a676-269b8a4230f4

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

Copy link

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.29%. Comparing base (9f0c578) to head (9b994cb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1966   +/-   ##
=======================================
  Coverage   81.29%   81.29%           
=======================================
  Files         822      822           
  Lines       52015    52014    -1     
=======================================
+ Hits        42284    42286    +2     
+ Misses       9731     9728    -3     

☔ 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