[PM-34623] Fix stale discount display after Stripe deletion#7391
Merged
amorask-bitwarden merged 1 commit intomainfrom Apr 6, 2026
Merged
[PM-34623] Fix stale discount display after Stripe deletion#7391amorask-bitwarden merged 1 commit intomainfrom
amorask-bitwarden merged 1 commit intomainfrom
Conversation
|
Contributor
|
New Issues (121)Checkmarx found the following issues in this Pull Request
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7391 +/- ##
==========================================
- Coverage 62.58% 58.43% -4.16%
==========================================
Files 2060 2060
Lines 91184 91208 +24
Branches 8114 8118 +4
==========================================
- Hits 57069 53297 -3772
- Misses 32144 36019 +3875
+ Partials 1971 1892 -79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cyprain-okeke
approved these changes
Apr 6, 2026
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-34623
📔 Objective
After Stripe fires
customer.discount.deleted, the web vault's subscription page (VNext path) continued to display the discount on the Premium line item. This happened becauseGetSchedulePhase2DiscountAsyncreturned the Phase 2 schedule discount without checking whether Phase 2 had already started — and because Phase 2 was created without anEndDate, so the schedule lingered indefinitely.This PR fixes both issues:
GetSchedulePhase2DiscountAsyncnow checks if Phase 2's start date has already passed. If it has, the discount was either applied to the live subscription or consumed/deleted by Stripe, so it is no longer returned as "upcoming."ResolvePhase2ForPremiumAsyncandResolvePhase2ForFamiliesAsyncnow setEndDate = StartDate + 1 yearon Phase 2, allowingEndBehavior = Releaseto auto-release the schedule after the billing cycle completes.GetCurrentPeriodEnd()returning null, logging an error and skipping schedule creation rather than risking aNullReferenceException.📸 Screenshots
Premium subscription in phase 2