-
Notifications
You must be signed in to change notification settings - Fork 18
Add more friendly error when corrected message is too long #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes #885 |
Also fixes #373 |
@ajax146 Can you please take a look at this. I still don't understand why it's failing tests. |
Don't worry about it. The current unit tests totally suck and they will be redone completely over time |
Alright. I just tested it and it seems to work as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The white check mark emoji can still cause the description to exceed 4096 characters if the updated_message is between 4078 and 4096 characters, as the white check mark adds 19 characters to the description
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
.c a pasdjfhakjsdfhjkhashdfkjasdgfjasdfjkaghsjdfpasdjfhakjsdfhjkhashdfkaas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds more friendly error messages when a corrected message exceeds allowable limits.
- Removes an existing test file for the correct command.
- Updates the correct_command function to check for both message length and excessive newline count before sending a message.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
techsupport_bot/tests/commands_tests/test_extensions_correct.py | Removed test cases for the correct command |
techsupport_bot/commands/correct.py | Adds length and newline count validations with friendly error messages |
Comments suppressed due to low confidence (1)
techsupport_bot/tests/commands_tests/test_extensions_correct.py:1
- [nitpick] Removing the test file reduces coverage for the correct command functionality; ensure that equivalent tests exist elsewhere to validate behavior.
Entire file removed
Add more friendly error when corrected message is too long