[PR #5532] [MERGED] [PM-23681] Update TotpCodeManager to use CipherListView #5846

Closed
opened 2025-11-27 00:15:25 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5532
Author: @SaintPatrck
Created: 7/16/2025
Status: Merged
Merged: 7/17/2025
Merged by: @SaintPatrck

Base: mainHead: PM-23681/totp-manager-cipher-list-view-support


📝 Commits (1)

  • 7c6d232 [PM-23681] Update TotpCodeManager to use CipherListView

📊 Changes

16 files changed (+470 additions, -25 deletions)

View changed files

app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherListViewExtensions.kt (+18 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManager.kt (+19 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManagerImpl.kt (+117 -7)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/model/VerificationCodeItem.kt (+0 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt (+0 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/model/TotpCodeItemData.kt (+0 -2)
app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherListViewExtensionsTest.kt (+60 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt (+8 -2)
app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherListViewUtil.kt (+123 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManagerTest.kt (+124 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt (+1 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemScreenTest.kt (+0 -2)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt (+0 -3)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt (+0 -3)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt (+0 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/verificationcode/util/VerificationCodeDataUtil.kt (+0 -1)

📄 Description

🎟️ Tracking

PM-23681

📔 Objective

This commit refactors TotpCodeManager and its implementation TotpCodeManagerImpl to primarily use CipherListView instead of CipherView for fetching and managing TOTP codes.

The following changes were made:

  • Added new methods to TotpCodeManager to support CipherListView:
    • getTotpCodesForCipherListViewsStateFlow
    • getTotpCodeStateFlow (overloaded for CipherListView)
  • Implemented these new methods in TotpCodeManagerImpl.
  • Removed the totpCode field from VerificationCodeItem and TotpCodeItemData as it's no longer directly needed by the UI after this refactor.
  • Updated tests to reflect these changes and ensure compatibility with CipherListView.
  • Introduced CipherListViewExtensions.kt with extension properties login and card to safely access type-specific data from CipherListView. This is used within TotpCodeManagerImpl to retrieve TOTP-related information.
  • Added tests for the new CipherListViewExtensions.

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/5532 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 7/16/2025 **Status:** ✅ Merged **Merged:** 7/17/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-23681/totp-manager-cipher-list-view-support` --- ### 📝 Commits (1) - [`7c6d232`](https://github.com/bitwarden/android/commit/7c6d23207ee32aafbfceba360b50984f3d853e63) [PM-23681] Update TotpCodeManager to use CipherListView ### 📊 Changes **16 files changed** (+470 additions, -25 deletions) <details> <summary>View changed files</summary> ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherListViewExtensions.kt` (+18 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManager.kt` (+19 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManagerImpl.kt` (+117 -7) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/model/VerificationCodeItem.kt` (+0 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt` (+0 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/model/TotpCodeItemData.kt` (+0 -2) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherListViewExtensionsTest.kt` (+60 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt` (+8 -2) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherListViewUtil.kt` (+123 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/TotpCodeManagerTest.kt` (+124 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt` (+1 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemScreenTest.kt` (+0 -2) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt` (+0 -3) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt` (+0 -3) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt` (+0 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/verificationcode/util/VerificationCodeDataUtil.kt` (+0 -1) </details> ### 📄 Description ## 🎟️ Tracking PM-23681 ## 📔 Objective This commit refactors `TotpCodeManager` and its implementation `TotpCodeManagerImpl` to primarily use `CipherListView` instead of `CipherView` for fetching and managing TOTP codes. The following changes were made: - Added new methods to `TotpCodeManager` to support `CipherListView`: - `getTotpCodesForCipherListViewsStateFlow` - `getTotpCodeStateFlow` (overloaded for `CipherListView`) - Implemented these new methods in `TotpCodeManagerImpl`. - Removed the `totpCode` field from `VerificationCodeItem` and `TotpCodeItemData` as it's no longer directly needed by the UI after this refactor. - Updated tests to reflect these changes and ensure compatibility with `CipherListView`. - Introduced `CipherListViewExtensions.kt` with extension properties `login` and `card` to safely access type-specific data from `CipherListView`. This is used within `TotpCodeManagerImpl` to retrieve TOTP-related information. - Added tests for the new `CipherListViewExtensions`. ## ⏰ 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 <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-27 00:15:25 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5846