[PM-39767] feat: Persist Premium upgrade pending state across syncs and app restarts - #2916
Draft
KatherineInCode wants to merge 1 commit into
Draft
[PM-39767] feat: Persist Premium upgrade pending state across syncs and app restarts#2916KatherineInCode wants to merge 1 commit into
KatherineInCode wants to merge 1 commit into
Conversation
…nd app restarts
Premium upgrade status ("pending"/"confirmed") was only tracked by an
ephemeral, per-checkout-attempt Combine subscription, and any sync failure
was silently swallowed and indistinguishable from "still waiting, no error."
This meant a later, unrelated sync (e.g. Settings > Vault > Sync Now, or a
sync triggered from the web vault) could never resolve a pending upgrade,
and there was no way to know a sync attempt had actually failed versus just
not finished yet.
BillingService now persists pending/failure state per-account via
BillingStateService, and watches sync completions generically (not just the
originating checkout attempt) so any successful sync can resolve a pending
upgrade. This is the foundation PR in a stack; later PRs build the CTA,
"Sync unsuccessful," and celebration-sheet UI on top of this state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-39767
📔 Objective
First of four stacked PRs addressing QA follow-up findings on PM-39767. This PR is the foundation only — no UI changes.
Today, whether a Premium upgrade is "pending" is tracked entirely by an ephemeral, per-checkout-attempt Combine subscription. Two consequences: (1) if a sync attempt fails outright, that failure is silently swallowed and indistinguishable from "still waiting, no error" — both produce the same
.pendingstatus; (2) a later, completely unrelated sync (e.g. Settings > Vault > Sync Now, or a sync triggered from the web vault) has no way to resolve a pending upgrade, since nothing generic is listening for it.This PR moves pending/failure state into
BillingService/BillingStateService, persisted per-account (AppSettingsStore-backed, survives app relaunch), and adds astart()subscription — following the existingAuthenticatorSyncServicepattern — that reacts to any successful sync completing, not just the one that originated the checkout attempt.ServiceContainergains one line kicking this off, mirroring howauthenticatorSyncService.start()is already wired up. NoAppProcessoror coordinator changes.This PR has no user-visible behavior on its own — nothing yet reads the new state. Later PRs in the stack build the CTA visibility, "Sync unsuccessful" callout, and celebration-sheet UI on top of it.
📸 Screenshots
Not applicable — no UI changes.