fix: IsValid accepts empty strings for non-nullable string fields (20.0.3)#461
Conversation
….0.3) PacketBase.IsValid constructed RequiredAttribute with default AllowEmptyStrings=false, so a non-nullable string property with an empty value (e.g. NsTestPacket.LeadingBlank = "" that models the literal double-space token) failed validation with "The <Type> field is required.". Empty tokens are legal on the wire; allow them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 30 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Symptom from live NosCore login traffic:
```
EROR -- Sending an invalid packet: header=NsTeST type=NosCore.Packets.ServerPackets.Login.NsTestPacket errors=[The NsTestPacket field is required.]
```
PacketBase.IsValid constructs `new RequiredAttribute()` which defaults to `AllowEmptyStrings = false`. That rejects `NsTestPacket.LeadingBlank = ""` — even though an empty token is exactly what the wire carries.
Switch to `new RequiredAttribute { AllowEmptyStrings = true }` so a non-nullable string property can legally hold `""`.
Test plan
🤖 Generated with Claude Code