fix(dashnote): drop misleading message maxLength from note schema#84
Conversation
The network enforces a 5120-byte per-field cap via max_field_value_size; JSON Schema maxLength counts characters, so any value here misrepresents the real limit. UI already gates input to 5120 B. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates field validation constraints in the dashnote application. The ChangesField validation constraints
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…moji Adds boundary cases at 5119/5120/5121 bytes plus 2-byte (é), 3-byte (CJK), 4-byte (emoji), and ZWJ-joined sequences to lock in that the byte gate catches multi-byte payloads a char-based maxLength would have let through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
maxLength: 10000from thenote.messageschema. JSON SchemamaxLengthcounts characters, but Dash Platform enforces a per-field byte cap viamax_field_value_size(5120 B / 5 KiB) at the network layer — the contract value misrepresented the real limit, and a user could pass schema validation only to be rejected by the state transition.maxLengthis absent.maxLengthcan't honestly mirror it.The UI already gates message input to 5120 bytes via src/lib/fieldLimits.ts, so user-visible behavior is unchanged.
Notes
DEFAULT_CONTRACT_IDstill resolves to the existing on-chain contract (which has the oldmaxLength: 10000). This is forward-compatible: any contract registered fresh from this code (Settings → Register) will use the cleaner schema, and existing documents on the old contract are unaffected because the network's byte cap was always the binding constraint.titlekeepsmaxLength: 120— well under 5120 B even in the worst case, so it stays an honest UX-level bound.Summary by CodeRabbit
Documentation
Updates