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-01-31] [$500] Web - Compose box - The compose box displays duplicate characters upon pressing a single key #33710

Closed
1 of 6 tasks
kbecciv opened this issue Dec 28, 2023 · 34 comments
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

@kbecciv
Copy link

kbecciv commented Dec 28, 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: v1.4.18-2
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. Open a conversation
  2. Click anywhere outside the compose box
  3. Press on any character on the keyboard (Only once)
  4. Observe the number of characters displayed inside of the compose box

Expected Result:

When a single key is pressed only a single character should be displayed inside the compose box

Actual Result:

When pressing only a single key duplicate characters are displayed inside the compose box

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

Bug6327462_1703768050385.27.12.2023_22.13.56_REC.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e5ce38ee6504ce3e
  • Upwork Job ID: 1740378947399057408
  • Last Price Increase: 2024-01-04
  • Automatic offers:
    • situchan | Reviewer | 28090824
    • bernhardoj | Contributor | 28090825
@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 28, 2023
@melvin-bot melvin-bot bot changed the title Web - Compose box - The compose box displays duplicate characters upon pressing a single key [$500] Web - Compose box - The compose box displays duplicate characters upon pressing a single key Dec 28, 2023
Copy link

melvin-bot bot commented Dec 28, 2023

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

Copy link

melvin-bot bot commented Dec 28, 2023

Triggered auto assignment to @strepanier03 (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 28, 2023
Copy link

melvin-bot bot commented Dec 28, 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 28, 2023

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 28, 2023

Proposal

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

The text is doubled when pressing a key while the composer is not focused.

What is the root cause of that problem?

We have a key-down listener that will:

  1. Focus on the composer
  2. Add the pressed key to the composer

const focusComposerOnKeyPress = useCallback(
(e) => {
const isComposerVisible = checkComposerVisibility();
if (!isComposerVisible) {
return;
}
if (!ReportUtils.shouldAutoFocusOnKeyPress(e)) {
return;
}
// if we're typing on another input/text area, do not focus
if (['INPUT', 'TEXTAREA'].includes(e.target.nodeName)) {
return;
}
focus();
replaceSelectionWithText(e.key, false);

The reason it added a duplicate character is, that the native input first receives the pressed key (because we focus on it, proof video below) and we manually add the pressed key to the composer.

image
Screen.Recording.2023-12-28.at.22.52.05.mov

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

Remove replaceSelectionWithText after focusing on the composer.

What alternative solutions did you explore? (Optional)

An alternate solution is to call preventDefault so the input won't receive any key and we will still manually add it with replaceSelectionWithText.

@melvin-bot melvin-bot bot added the Overdue label Jan 1, 2024
Copy link

melvin-bot bot commented Jan 1, 2024

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

Copy link

melvin-bot bot commented Jan 2, 2024

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

@strepanier03
Copy link
Contributor

I've been OoO, taking a look now.

@melvin-bot melvin-bot bot removed the Overdue label Jan 4, 2024
@strepanier03
Copy link
Contributor

Weird, but reproducible.

Chrome/Web

2024-01-03_16-17-15.mp4

@strepanier03
Copy link
Contributor

Checking internally, here, to see if it's a good fit for Wave 5.

@aswin-s
Copy link
Contributor

aswin-s commented Jan 4, 2024

This issue is already fixed in this PR. Sadly the review is blocked for quite some time now.

Copy link

melvin-bot bot commented Jan 4, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@situchan
Copy link
Contributor

situchan commented Jan 8, 2024

Seems like #30955 has been stale for long time.
I am not sure we should hold this for that. This issue is never related to emoji.

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@situchan
Copy link
Contributor

situchan commented Jan 8, 2024

The current behavior is weird and I think we should fix this as urgency

Screen.Recording.2024-01-08.at.10.32.29.PM.mov

@strepanier03
Copy link
Contributor

Raised again to try to tie to another project for priority purposes. Will update as soon as possible.

@bernhardoj
Copy link
Contributor

@situchan I tested all 3 issues reproduction steps and the solution here won't cause that issue again.

@situchan
Copy link
Contributor

situchan commented Jan 9, 2024

Remove replaceSelectionWithText after focusing on the composer.

@bernhardoj can you find the exact PR which added that line?

@bernhardoj
Copy link
Contributor

It was added since the first time of the feature #21583.

Probably we need it before because the focus is delayed inside InteractionManager.

I think it has the same root cause as #31210 https://github.com/Expensify/App/pull/24482/files#r1429943408.

Copy link

melvin-bot bot commented Jan 9, 2024

Triggered auto assignment to @arosiclair, 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 9, 2024
Copy link

melvin-bot bot commented Jan 9, 2024

📣 @situchan 🎉 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 9, 2024

📣 @bernhardoj 🎉 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 📖

@bernhardoj
Copy link
Contributor

PR is ready

cc: @situchan

@quinthar
Copy link

What's the update on this? Who is doing what, and when will it be done? It looks like we have a 2-week old undeployed fix?

@bernhardoj
Copy link
Contributor

Currently waiting for review.
cc: @situchan

@situchan
Copy link
Contributor

Provided feedback. Was testing and finding any possible regressions

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 24, 2024
@melvin-bot melvin-bot bot changed the title [$500] Web - Compose box - The compose box displays duplicate characters upon pressing a single key [HOLD for payment 2024-01-31] [$500] Web - Compose box - The compose box displays duplicate characters upon pressing a single key Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 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 Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.30-1 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-01-31. 🎊

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

Copy link

melvin-bot bot commented Jan 24, 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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@strepanier03] 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 and removed Weekly KSv2 labels Jan 30, 2024
@strepanier03
Copy link
Contributor

strepanier03 commented Jan 30, 2024

Pay date is tomorrow so I'll handle this then.

@situchan - Feel free to @ mention me when you post the checklist.

Be back to this tomorrow.

@situchan
Copy link
Contributor

We can skip regression test as this was discovered by QA team

@strepanier03
Copy link
Contributor

Awesome, thank you @situchan! Handling payment now for everyone.

@strepanier03
Copy link
Contributor

Both @bernhardoj and @situchan have been paid. Closing this out as complete. Thanks everyone!

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
Status: CRITICAL
Development

No branches or pull requests

7 participants