[PR #6949] [MERGED] [PM-37289] fix: Refresh archive row after premium upgrade #86787

Closed
opened 2026-05-23 01:00:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6949
Author: @SaintPatrck
Created: 5/20/2026
Status: Merged
Merged: 5/20/2026
Merged by: @SaintPatrck

Base: mainHead: premium-upgrade/pm-37289-archive-refresh-on-premium


📝 Commits (1)

📊 Changes

2 files changed (+110 additions, -3 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt (+13 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt (+97 -2)

📄 Description

🎟️ Tracking

PM-37289

📔 Objective

The Archive row on the Vault screen kept showing its locked state — zero count, lock icon, "Premium required" subtext — after a user upgraded to Premium. The row updated correctly only after a manual pull-to-refresh or app restart, making freshly-paid customers believe the upgrade had not taken effect.

VaultViewModel.handleUserStateUpdateReceive writes the new isPremium value into state on profile updates, but the Archive row's UI fields are precomputed in VaultDataExtensions.kt when the viewState is first built and are not re-derived from state on each emission. When isPremium flips, the vault data flow does not re-emit, so the stale precomputed fields stay on screen.

Triggering a updateViewState call on the isPremium transition re-derives those fields against the cached vaultDataStateFlow.value, surfacing the new entitlement immediately and keeping the rest of the screen stable for unrelated profile updates.


🔄 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/6949 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 5/20/2026 **Status:** ✅ Merged **Merged:** 5/20/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `premium-upgrade/pm-37289-archive-refresh-on-premium` --- ### 📝 Commits (1) - [`db331c4`](https://github.com/bitwarden/android/commit/db331c4731de72502683d6433dda6ce5e52d71f3) [PM-37289] fix: Refresh archive row after premium upgrade ### 📊 Changes **2 files changed** (+110 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt` (+13 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt` (+97 -2) </details> ### 📄 Description ## 🎟️ Tracking [PM-37289](https://bitwarden.atlassian.net/browse/PM-37289) ## 📔 Objective The Archive row on the Vault screen kept showing its locked state — zero count, lock icon, "Premium required" subtext — after a user upgraded to Premium. The row updated correctly only after a manual pull-to-refresh or app restart, making freshly-paid customers believe the upgrade had not taken effect. `VaultViewModel.handleUserStateUpdateReceive` writes the new `isPremium` value into state on profile updates, but the Archive row's UI fields are precomputed in `VaultDataExtensions.kt` when the viewState is first built and are not re-derived from state on each emission. When `isPremium` flips, the vault data flow does not re-emit, so the stale precomputed fields stay on screen. Triggering a `updateViewState` call on the `isPremium` transition re-derives those fields against the cached `vaultDataStateFlow.value`, surfacing the new entitlement immediately and keeping the rest of the screen stable for unrelated profile updates. [PM-37289]: https://bitwarden.atlassian.net/browse/PM-37289?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <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 2026-05-23 01:00:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#86787