[PM-16095] validation message updates server - #8295
Conversation
…-16095-validation-message-updates-server
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the invite-user validation error message changes across the Password Manager, Provider, and self-host environment validators, plus the supporting Code Review Details
|
| public ProviderType Type { get; init; } | ||
| public ProviderStatusType Status { get; init; } | ||
| public bool Enabled { get; init; } | ||
| public int? Seats { get; init; } |
There was a problem hiding this comment.
♻️ DEBT: Seats on a provider model holds the organization's seat count, which reads as provider seats.
Details and fix
The only call site passes the organization's seat total:
new InviteOrganizationProvider(provider, request.Seats) // request is PasswordManagerSubscriptionUpdateProviders have their own seat concepts (ProviderPlan.SeatMinimum, PurchasedSeats, AllocatedSeats), so a bare Seats on InviteOrganizationProvider is ambiguous. In ProviderBillableSeatLimitError/ProviderResellerSeatLimitError the message renders "Contact your provider to purchase additional seats" next to invalidRequest.Seats, which reinforces the wrong reading.
Renaming to OrganizationSeats (and the constructor parameter to organizationSeats) removes the ambiguity with no behavior change.
| private static string GetErrorMessage(PasswordManagerSubscriptionUpdate invalidRequest) => | ||
| string.Format(Code, invalidRequest.Seats); | ||
|
|
||
| public const string Code = "Seat limit of {0} has been reached. Contact Customer Support to upgrade your plan."; |
There was a problem hiding this comment.
❓ QUESTION: Was PasswordManagerSeatLimitHasBeenReachedError intentionally left out of this update?
Details
Three errors in this PR moved to "Seat limit of {0} has been reached. …", but PasswordManagerSeatLimitHasBeenReachedError (line 8) still reads "Seat limit has been reached." That one fires from InviteUsersPasswordManagerValidator.ValidatePasswordManager when MaxSeatsExceeded is true, which is the most common seat-limit path for cloud organizations, so users hitting the autoscale ceiling will see the old copy while the plan/provider/self-host paths show the new copy.
If design did include it, the natural substitution would be MaxAutoScaleSeats (the limit that was exceeded) rather than Seats. If it was deliberately scoped out, no change needed.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8295 +/- ##
==========================================
- Coverage 63.67% 63.66% -0.01%
==========================================
Files 2467 2467
Lines 105693 105699 +6
Branches 9551 9551
==========================================
Hits 67295 67295
- Misses 36082 36088 +6
Partials 2316 2316 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-16095
📔 Objective
Changes up validation messages to messages that design signed off on