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

[$500] Chat - There's a delay for showing the "over 10 000" message again #33612

Closed
5 of 6 tasks
kbecciv opened this issue Dec 26, 2023 · 20 comments
Closed
5 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Dec 26, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.17.1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Draft a message over 10 000 characters in any chat
  3. Navigate to any other conversation
  4. Navigate back

Expected Result:

The error message should be visible without any delay.

Actual Result:

There's a delay for showing the "over 10 000" message again.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6326339_1703616047941.Over_the_limit_draft.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0104997dec9d66e892
  • Upwork Job ID: 1739720256516771840
  • Last Price Increase: 2023-12-26
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 28077578
    • aswin-s | Contributor | 28077579
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 26, 2023
@melvin-bot melvin-bot bot changed the title Chat - There's a delay for showing the "over 10 000" message again [$500] Chat - There's a delay for showing the "over 10 000" message again Dec 26, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

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

Copy link

melvin-bot bot commented Dec 26, 2023

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 26, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 26, 2023

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

@aswin-s
Copy link
Contributor

aswin-s commented Dec 26, 2023

Proposal

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

Error message The maximum comment length is 10,000 characters is only shown after a delay.

What is the root cause of that problem?

The method used to check the max comment length validateCommentMaxLength is debounced with a timeout of 1500ms. So it will execute only after 1.5 seconds from the last OnChange event from ComposerWithSuggestions gets fired.

const validateCommentMaxLength = useMemo(() => _.debounce(handleValueChange, 1500), [handleValueChange]);

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

This seems to be intentional to prevent multiple invocations within a short duration. To fix the initial delay, set debounce method to invoke immediately on first execution by setting {leading: true} as option. This will make sure that the function will execute immediately on the first call, instead of waiting for the debounce time to elapse. Further invocations will be delayed as per the timeout set.

const validateCommentMaxLength = useMemo(() => _.debounce(handleValueChange, 1500, { leading: true }), [handleValueChange]);

What alternative solutions did you explore? (Optional)

Instead of completely removing it, we could reduce the timeout to 500ms, which will ensure that the error will be shown much faster. Also the validation will get executed only a maximum of 2 times with in a second.

// update timeout to 500ms
const validateCommentMaxLength = useMemo(() => _.debounce(handleValueChange, 500), [handleValueChange]);

@zboutchyard
Copy link

zboutchyard commented Dec 26, 2023

Contributor details
Your Expensify account email: zackboutchyard@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01f58c287df6a2b1c7

Proposal

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

Error message The maximum comment length is 10,000 characters is only shown after a delay.

What is the root cause of that problem?

The method that is used to validate the content length validateCommentMaxLength is fired off every time the view loads, which causes the debounce to fire and the message to show up 1.5 seconds later

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

For immediate feedback, you could add a length check directly in the text input's onChange handler. This check would not set any state but could display a warning message next to the input field in real-time. The debounced function would still be responsible for setting the state.

Copy link

melvin-bot bot commented Dec 26, 2023

📣 @zboutchyard! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot melvin-bot bot added the Overdue label Dec 29, 2023
Copy link

melvin-bot bot commented Jan 1, 2024

@JmillsExpensify, @abdulrahuman5196 Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Jan 1, 2024

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

@abdulrahuman5196
Copy link
Contributor

Sorry for the delay. Will review in my morning.

@melvin-bot melvin-bot bot removed the Overdue label Jan 1, 2024
@abdulrahuman5196
Copy link
Contributor

Reviewing now

@abdulrahuman5196
Copy link
Contributor

@aswin-s 's proposal here #33612 (comment) looks good and works well.

🎀 👀 🎀
C+ Reviewed

Copy link

melvin-bot bot commented Jan 2, 2024

Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

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

melvin-bot bot commented Jan 2, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Jan 2, 2024

📣 @aswin-s 🎉 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 added Reviewing Has a PR in review and removed Daily KSv2 labels Jan 2, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Jan 2, 2024
@aswin-s
Copy link
Contributor

aswin-s commented Jan 18, 2024

PR got deployed to production a week ago. Melvin doesn't seem to bother.

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression.

Determine if we should create a regression test for this bug.

Yes.

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.

  1. Navigate to NewDot.
  2. Draft a message over 10 000 characters in any chat
  3. Navigate to any other conversation
  4. Navigate back
  5. Verify that the error message The maximum comment length is 10,000 characters is only shown without any delay.

@JmillsExpensify Seems melvin didn't update this issue. Its pending payment now since the change was deployed to production 2 weeks ago. Added BZ checklist as well.

@aswin-s
Copy link
Contributor

aswin-s commented Jan 24, 2024

@JmillsExpensify Gentle Reminder ☝️

@JmillsExpensify
Copy link

Thanks for the DM! Looks like the automation failed. Payment summary:

@JmillsExpensify
Copy link

All contracts paid out. As for the regression test, I'm not sure this is required. This is an inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants