-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Context
In DialogTransmissionAppender.Append, transmission counts are cast to short when updating FromPartyTransmissionsCount and FromServiceOwnerTransmissionsCount:
dialog.FromPartyTransmissionsCount += (short)fromParty;
dialog.FromServiceOwnerTransmissionsCount += (short)fromServiceOwner;Currently, a checked cast will be added to throw an exception on overflow, but this should be complemented with application-level validation that prevents the overflow scenario from occurring in the first place.
Proposed Solution
Add validation logic that:
- Checks if the new transmission counts would exceed
short.MaxValue(32,767) before performing the cast - Returns a clear validation error to the caller if the limit would be exceeded
- Prevents the need to catch overflow exceptions during normal operation
This validation should be added at the command/DTO validation level where appropriate, so users receive a clear error message rather than an exception.
Backlinks
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
New issues