Skip to content

Add payload size limit #3017

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

Merged
merged 11 commits into from
Mar 31, 2025
Merged

Add payload size limit #3017

merged 11 commits into from
Mar 31, 2025

Conversation

yiwen101
Copy link
Contributor

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

Checklist

  • I have tested this code
  • I have updated the documentation

@yiwen101
Copy link
Contributor Author

yiwen101 commented Aug 12, 2024

Corresponding BE PR: source-academy/backend#1151

@yiwen101 yiwen101 changed the title Add payload_size_limit Add payload size limit Aug 12, 2024
@coveralls
Copy link

coveralls commented Aug 12, 2024

Pull Request Test Coverage Report for Build 14175086497

Details

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.006%) to 31.098%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pages/sicp/subcomponents/chatbot/ChatBox.tsx 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
src/pages/sicp/subcomponents/chatbot/ChatBox.tsx 2 7.04%
Totals Coverage Status
Change from base Build 14174668514: -0.006%
Covered Lines: 4888
Relevant Lines: 14827

💛 - Coveralls

Comment on lines 25 to 28
const MESSAGE_TOO_LONG_MESSAGE: Readonly<ChatMessage> = {
content: 'Your message is too long. Please try again with a shorter message.',
role: 'assistant'
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way, this will never be necessary. From UX perspective, it's easier for the user to edit their message before sending in order to fit the character limit, as opposed to having to copy and paste their previous message and send it again. Not to mention, if you do it like this, there will be a mismatch between the conversation history stored in the FE state with the one stored in the DB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right;
it is more intuitive to do let the user trigger this in the first place;
this also pollute the chat history, making it less readable.

@yiwen101 yiwen101 requested a review from sayomaki September 25, 2024 16:50
@yiwen101
Copy link
Contributor Author

@RichDom2185 Could you review this again. Is it ready for merge?

@RichDom2185 RichDom2185 self-requested a review March 16, 2025 07:58
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot and sorry for the delayed review!

@RichDom2185 RichDom2185 enabled auto-merge (squash) March 31, 2025 15:19
@RichDom2185 RichDom2185 merged commit 0bd3a5e into master Mar 31, 2025
8 checks passed
@RichDom2185 RichDom2185 deleted the payload_size_limit branch March 31, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants