[PR #4235] [MERGED] PM-14353 : Clean up consumed snackbar on quick resubmission due to state based nav. #4792

Closed
opened 2025-11-26 23:49:49 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4235
Author: @dseverns-livefront
Created: 11/5/2024
Status: Merged
Merged: 11/6/2024
Merged by: @dseverns-livefront

Base: mainHead: PM-14353-snackbar-after-switch


📝 Commits (1)

  • b917272 PM-14353 clear the snackbar relay when switching accounts to prevent race on subscription

📊 Changes

5 files changed (+69 additions, -16 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManager.kt (+5 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManagerImpl.kt (+6 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt (+4 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManagerTest.kt (+29 -9)
📝 app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt (+25 -6)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14353

📔 Objective

  • Snackbar was briefly showing while the account was switched, due to the navigation being user state based the next instance of the VaultViewModel was collecting from the shared flow before it was removed from the internal map on completion of the previous instance.
  • Added a function to explicitly clear the replay cache.

📸 Screenshots

before after
example pm14353after.webm

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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/4235 **Author:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Created:** 11/5/2024 **Status:** ✅ Merged **Merged:** 11/6/2024 **Merged by:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Base:** `main` ← **Head:** `PM-14353-snackbar-after-switch` --- ### 📝 Commits (1) - [`b917272`](https://github.com/bitwarden/android/commit/b91727201d25b055a047201df13e41ba3de1f78c) PM-14353 clear the snackbar relay when switching accounts to prevent race on subscription ### 📊 Changes **5 files changed** (+69 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManager.kt` (+5 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManagerImpl.kt` (+6 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt` (+4 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/manager/snackbar/SnackbarRelayManagerTest.kt` (+29 -9) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt` (+25 -6) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-14353 <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective - Snackbar was briefly showing while the account was switched, due to the navigation being user state based the next instance of the VaultViewModel was collecting from the shared flow before it was removed from the internal map on completion of the previous instance. - Added a function to explicitly clear the replay cache. <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> ## 📸 Screenshots | before | after | |--------|--------| | [example](https://github.com/user-attachments/assets/532028a8-4d41-4ab9-9cd1-43167ba4f94e) | [pm14353after.webm](https://github.com/user-attachments/assets/4fecf845-a430-416b-84ac-8ee1b1144abe) | <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation 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-26 23:49:49 -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#4792