Skip to content
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

[HOLD for payment 2024-10-25] [$250] Chat - User is able to send message with max character limit #48888

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 10, 2024 · 30 comments
Closed
2 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 10, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.31-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4943661
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to any 1:1 conversation
  2. Enter a text that is over 10k characters but less than 15K characters - You can use Lorem Ipsum generator for this
  3. After the compose box displays an error that the maximum amount of characters is 10k, add attachment
  4. Send the message with the attachment

Expected Result:

User should not be able to send messages over 10k characters

Actual Result:

User is able to send messages over 10k characters if there is added attachment.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6597905_1725908762232.Screen_Recording_20240909_214223_Chrome.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838751947628833125
  • Upwork Job ID: 1838751947628833125
  • Last Price Increase: 2024-10-02
  • Automatic offers:
    • nyomanjyotisa | Contributor | 104327662
Issue OwnerCurrent Issue Owner: @anmurali
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@anmurali I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Sep 10, 2024

Edited by proposal-police: This proposal was edited at 2024-09-10 13:03:27 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Chat - User is able to send message with max character limit

What is the root cause of that problem?

We don't disable the Send button on Send Attachment modal if the message exceed the max char on the composer

What changes do you think we should make in order to solve the problem?

Add new props here called shouldDisableSendButton default to false

and disabled the send button if it true here

isDisabled={isConfirmButtonDisabled || shouldDisableSendButton}

Then here pass the hasExceededMaxCommentLength as shouldDisableSendButton

<AttachmentModal
    headerTitle={translate('reportActionCompose.sendAttachment')}
    onConfirm={addAttachment}
    onModalShow={() => setIsAttachmentPreviewActive(true)}
    onModalHide={onAttachmentPreviewClose}
    shouldDisableSendButton={hasExceededMaxCommentLength}
>

Or we can assign the shouldDisableSendButton as default value here

const [isConfirmButtonDisabled, setIsConfirmButtonDisabled] = useState(shouldDisableSendButton);

and don't change this

Result
image

What alternative solutions did you explore? (Optional)

We can disable the attachment item on the popovermenu if hasExceededMaxCommentLength

Add new props here shouldDisableAttachmentItem default to false

Add disabled using the shouldDisableAttachmentItem value here

{
    icon: Expensicons.Paperclip,
    text: translate('reportActionCompose.addAttachment'),
    onSelected: () => {
        if (Browser.isSafari()) {
            return;
        }
        triggerAttachmentPicker();
    },
    shouldCallAfterModalHide: true,
    disabled: shouldDisableAttachmentItem,
},

Then here pass the hasExceededMaxCommentLength as shouldDisableAttachmentItem

<AttachmentPickerWithMenuItems
    ...
    shouldDisableAttachmentItem={hasExceededMaxCommentLength}
/>

Result
image

@dominictb
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • User is able to send messages over 10k characters if there is added attachment.

What is the root cause of that problem?

  • In here, we don't have a logic to throw an error modal if the comment length is greater than 10K characters.

What changes do you think we should make in order to solve the problem?

  • We should pass down the hasExceededMaxCommentLength from here to here.

  • Then, in AttachmentModal, use the hasExceededMaxCommentLength in here:

        if (hasExceededMaxCommentLength) {
            setIsModalOpen(false);
            setIsAttachmentInvalid(true);
            setAttachmentInvalidReasonTitle('attachmentPicker.maxLengthExceed');
            setAttachmentInvalidReason('attachmentPicker.maxLengthExceedSubtitle');
            return false;
        }
  • With the above change, when the comment length is greater than 10K and we press on "Send" button in attachment modal, the error modal will be shown.

  • Optional, we can display the danger modal instead of success modal by adding prop danger here if hasExceededMaxCommentLength is true.

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2024-09-11.at.19.09.51.mov

@melvin-bot melvin-bot bot added the Overdue label Sep 12, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Sep 17, 2024

@anmurali 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Sep 19, 2024

@anmurali 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Sep 23, 2024

@anmurali 12 days overdue. Walking. Toward. The. Light...

Copy link

melvin-bot bot commented Sep 24, 2024

@anmurali this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Sep 25, 2024
@melvin-bot melvin-bot bot changed the title Chat - User is able to send message with max character limit [$250] Chat - User is able to send message with max character limit Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021838751947628833125

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (External)

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@mananjadhav
Copy link
Collaborator

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • We can send a message > 10,000 characters if sent via the attachment.

What is the root cause of that problem?

  • There is no validation for onConfirm call in the AttachmentModal that verifies the character length.

What changes do you think we should make in order to solve the problem?

  • I think we should also solve this from the backend if we do want to enforce the character limit.
  • Second we need to pass hasExceededMaxCommentLength to AttachmentModal as a new prop isSendDisabled

const {hasExceededMaxCommentLength, validateCommentMaxLength} = useHandleExceedMaxCommentLength();

  • Then in AttachmentModal we can disable the Button using isSendDisabled || isConfirmButtonDisabled condition and also reuse <ExceededCommentLength /> to show up just above the send button.
image

What alternative solutions did you explore? (Optional)

  • We disable the + actions menu when the ExceededCommentLength flag is true.

Copy link

melvin-bot bot commented Sep 30, 2024

@anmurali, @Pujan92 Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
@Pujan92
Copy link
Contributor

Pujan92 commented Sep 30, 2024

I will review this tomorrow.

@melvin-bot melvin-bot bot removed the Overdue label Sep 30, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Oct 4, 2024

@anmurali, @Pujan92 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Oct 4, 2024
@anmurali
Copy link

anmurali commented Oct 5, 2024

@Pujan92 - This still needs your review, can you pls prioritize this?

@melvin-bot melvin-bot bot added the Overdue label Oct 8, 2024
@jasperhuangg
Copy link
Contributor

jasperhuangg commented Oct 8, 2024

@Pujan92 I think we should actually go with both @nyomanjyotisa's primary and alternative solutions of disabling the "Add attachment" and "Send" buttons. It seems safer to disable them in both places in the UI.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 8, 2024
Copy link

melvin-bot bot commented Oct 8, 2024

📣 @nyomanjyotisa 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot removed the Overdue label Oct 8, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 9, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 18, 2024
@melvin-bot melvin-bot bot changed the title [$250] Chat - User is able to send message with max character limit [HOLD for payment 2024-10-25] [$250] Chat - User is able to send message with max character limit Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Oct 18, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@Pujan92] The PR that introduced the bug has been identified. Link to the PR:
  • [@Pujan92] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@Pujan92] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@Pujan92] Determine if we should create a regression test for this bug.
  • [@Pujan92] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 25, 2024
@Pujan92
Copy link
Contributor

Pujan92 commented Oct 28, 2024

Regression Test Steps

  1. Open any report
  2. Enter a text with more than 10k characters
  3. Once the composer shows an error of length exceeded, click the + button to add an attachment
  4. Verify that the add attachment option is disabled / send button of attachment modal is disabled

Copy link

melvin-bot bot commented Oct 28, 2024

@anmurali, @Pujan92, @jasperhuangg, @nyomanjyotisa Whoops! This issue is 2 days overdue. Let's get this updated quick!

@anmurali
Copy link

anmurali commented Oct 29, 2024

Payment Summary

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

@anmurali @jasperhuangg Be sure to fill out the Contact List!

@garrettmknight
Copy link
Contributor

$250 approved for @Pujan92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants