Closed RiccardoM closed 7 months ago
[!WARNING]
Rate Limit Exceeded
@RiccardoM has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 35 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. 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](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between b085e046f84620833f82a08d5ed1f101b2af1ca6 and 036ca6bb52fe110bb83faef173764f5d9b1f5f82.
The update introduces enhancements to the text length validation process for posts and reactions. Specifically, it adds methods to calculate the text length directly within the respective data structures (Post
and FreeTextValue
) and incorporates these methods into the validation logic. Additionally, new tests ensure these methods work correctly across various text scenarios.
Files | Change Summaries |
---|---|
.../keeper/posts.go , .../types/models.go , .../types/models_test.go |
Updated ValidatePost to use GetTextLength() ; added GetTextLength method and test in Post . |
.../keeper/reactions.go , .../types/models.go , .../types/models_test.go |
Updated validation to use GetLength() ; added GetLength method and test in FreeTextValue . |
"In the land of code where the snippets roam free,
A rabbit hopped in, as happy as can be. 🐇
With a flip and a hop, it refined the text check,
Making posts and reactions perfectly spec.
'Let's celebrate,' it said, with a cheerful decree,
For our code is now cleaner, as clean as can be!"
🎉🥕📝
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
This PR fixes how the text lengths related to a
Post
or aFreeTextReactionValue
are computed. Previously the count would only consider the byte size of the text. Instead, it's much better to count graphemes.As per this comment:
By counting graphemes instead of runes or bytes, we can assure a consistent user experience with any application that implementes client-based char count.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change