Skip to content

[PM-29956] Add logging to sponsorship redemption flow#19947

Merged
connerbw merged 4 commits into
mainfrom
billing/PM-29956/add-sponsorship-redeem-logging
Apr 20, 2026
Merged

[PM-29956] Add logging to sponsorship redemption flow#19947
connerbw merged 4 commits into
mainfrom
billing/PM-29956/add-sponsorship-redeem-logging

Conversation

@connerbw
Copy link
Copy Markdown
Contributor

@connerbw connerbw commented Apr 2, 2026

🎟️ Tracking

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

📔 Objective

Add client-side console logging to the Families for Enterprise sponsorship redemption flow to capture diagnostic information when users encounter errors.

Changes:

  • families-for-enterprise-setup.component.ts — logs via LogService (browser console) at each step: token presence/length, pre-validation result, organization creation success, redeem start, redeem success, and on failure the full ErrorResponse including statusCode, message, and validationErrors

All logs are prefixed with [Sponsorship] for easy filtering in DevTools. No PII is logged — only internal IDs, enum values, status codes, and server-provided error messages.

This is the client-side companion to the server-side logging PR. Together they cover model state validation failures (client captures the response) and business logic failures (server logs the specific gate that rejected the request).

@connerbw
Copy link
Copy Markdown
Contributor Author

connerbw commented Apr 2, 2026

Companion PR: bitwarden/server#7381

@connerbw connerbw added the ai-review Request a Claude code review label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds client-side console logging to the Families for Enterprise sponsorship redemption flow in families-for-enterprise-setup.component.ts. The changes inject LogService and add structured log statements at key decision points: token presence checks, pre-validation results, redeem start/success/failure, and organization creation callbacks. All logs use a consistent [Sponsorship] prefix for filtering.

No security, correctness, or breaking change issues were identified. No sensitive data (tokens, PII) is logged -- only internal IDs, enum values, status codes, and server-provided error messages. The removal of the no-unused-vars eslint-disable on the catch variable is a correct cleanup since e is now referenced in the error logging block.

Code Review Details

No findings to report. The changes are well-scoped diagnostic logging with appropriate log levels and no risk of data exposure.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.92%. Comparing base (f7475d8) to head (8c9da12).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...orships/families-for-enterprise-setup.component.ts 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19947      +/-   ##
==========================================
- Coverage   46.92%   46.92%   -0.01%     
==========================================
  Files        3909     3909              
  Lines      118268   118283      +15     
  Branches    18093    18096       +3     
==========================================
- Hits        55502    55501       -1     
- Misses      58593    58609      +16     
  Partials     4173     4173              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Logo
Checkmarx One – Scan Summary & Details84bb2304-f5a8-432e-8b29-e12db8882c08

Great job! No new security vulnerabilities introduced in this pull request

@connerbw connerbw marked this pull request as ready for review April 2, 2026 17:38
@connerbw connerbw requested a review from a team as a code owner April 2, 2026 17:38
@connerbw connerbw requested a review from JaredScar April 2, 2026 17:38
@connerbw connerbw removed the ai-review Request a Claude code review label Apr 2, 2026
JaredScar
JaredScar previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Contributor

@JaredScar JaredScar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for Admin-Console changes, thanks! Merge conflicts will need fixing though, feel free to DM me on Slack when need a re-review!

…sponsorship-redeem-logging

# Conflicts:
#	apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts
@sonarqubecloud
Copy link
Copy Markdown

@connerbw connerbw merged commit 56f885c into main Apr 20, 2026
70 of 72 checks passed
@connerbw connerbw deleted the billing/PM-29956/add-sponsorship-redeem-logging branch April 20, 2026 15:14
jaasen-livefront pushed a commit that referenced this pull request Apr 22, 2026
* [PM-29956] Add client-side logging to sponsorship redemption flow

* Fix prettier formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants