[PM-29956] Add logging to sponsorship redemption flow#7381
Merged
cturnbull-bitwarden merged 1 commit intomainfrom Apr 2, 2026
Merged
[PM-29956] Add logging to sponsorship redemption flow#7381cturnbull-bitwarden merged 1 commit intomainfrom
cturnbull-bitwarden merged 1 commit intomainfrom
Conversation
Contributor
Author
|
Companion PR: bitwarden/clients#19947 |
|
amorask-bitwarden
approved these changes
Apr 2, 2026
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 #7381 +/- ##
==========================================
+ Coverage 58.42% 58.44% +0.01%
==========================================
Files 2060 2060
Lines 91099 91159 +60
Branches 8096 8098 +2
==========================================
+ Hits 53222 53275 +53
- Misses 36001 36006 +5
- Partials 1876 1878 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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-29956
📔 Objective
Add structured logging to the sponsorship redemption flow to diagnose intermittent 400 "model state is invalid" errors reported by EU users attempting to redeem Families for Enterprise sponsorships.
Changes:
OrganizationSponsorshipsController.RedeemSponsorship— logs at each validation gate (token validation, ownership check, policy check) and on success, keyed by SponsorshipId and SponsoredOrganizationIdSetUpSponsorshipCommand— logs at each step of the billing setup (existing sponsorship check, plan type validation, expiry check, product type match, billing path selection) and on completionNo PII is logged — only internal IDs, enum values, and feature flag states.
If the reported 400 is caused by model state validation (before the action executes), the absence of the "Sponsorship redemption started" log combined with a 400 in traces will confirm that. The companion client-side PR captures the actual
validationErrorsfrom the response body.