Skip to content

Conversation

dkay0670
Copy link
Contributor

Add more friendly error when corrected message is too long

@dkay0670
Copy link
Contributor Author

Fixes #885

@dkay0670
Copy link
Contributor Author

Also fixes #373

@dkay0670 dkay0670 marked this pull request as draft February 18, 2024 04:36
@dkay0670
Copy link
Contributor Author

@ajax146 Can you please take a look at this. I still don't understand why it's failing tests.

@ajax146
Copy link
Contributor

ajax146 commented Apr 30, 2025

Don't worry about it. The current unit tests totally suck and they will be redone completely over time

@dkay0670
Copy link
Contributor Author

Alright. I just tested it and it seems to work as expected

@dkay0670 dkay0670 marked this pull request as ready for review April 30, 2025 23:15
@dkay0670 dkay0670 requested a review from ajax146 May 2, 2025 18:30
Copy link
Contributor

@ajax146 ajax146 left a 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

@dkay0670 dkay0670 requested review from ajax146 and Copilot May 3, 2025 05:41
Copy link
Contributor

@Copilot Copilot AI left a 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

@ajax146 ajax146 merged commit 92aa8f2 into r-Techsupport:main May 4, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correction Needs to not exceed 6000 characters Correct needs a length check
2 participants