Uh oh!
There was an error while loading. Please reload this page.
fix(incident): clarify comment length cap unit and report actual count - #166
Merged
Conversation
The 'incident comment' help said 'at most 1024 characters' without stating the unit, so scripts measuring with wc -c (bytes) over-trim compliant multibyte text. State that the limit counts Unicode characters (runes), not bytes, and point at wc -m. The over-cap error also said only 'must be at most 1024 characters'. It now reports the actual character count alongside the limit (e.g. 'content is 1025 characters, limit is 1024') so the caller knows how much to trim. The counting was already rune-based and matches the server-side check; only the message changed.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
flashduty incident commentrejects comment text longer than 1024 characters. Two usability gaps around that cap:wc -c(bytes) over-trims multibyte text (e.g. Chinese) that is actually compliant.--comment-file content must be at most 1024 characters, leaving the caller to guess how much to trim.Changes
wc -m, notwc -c.--comment-file content is 1025 characters, limit is 1024. It still fails before any API call is made.The counting itself was already rune-based (
len([]rune(...))), matching the server-side check; the cap value is unchanged. Only the message and help text changed.Tests
wc -mguidance is present.make fmt,make lint,make test(go test -race ./...),make check-cards,make buildall pass.