Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.53k stars 2.88k forks source link

[HOLD for payment 2024-01-31] [$500] Web - Compose box - The compose box displays duplicate characters upon pressing a single key #33710

Closed kbecciv closed 9 months ago

kbecciv commented 10 months ago

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?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/272a4186-f69a-41a3-91df-fb33b936b2a9

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
melvin-bot[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 10 months ago

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

bernhardoj commented 10 months ago

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

https://github.com/Expensify/App/blob/88d837c2e88c8c4c22a4c80f93b622d634e67290/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js#L455-L472

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

https://github.com/Expensify/App/assets/50919443/04292de8-fcbe-4341-94c5-3f7b74d670ae

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[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

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

strepanier03 commented 10 months ago

I've been OoO, taking a look now.

strepanier03 commented 10 months ago

Weird, but reproducible.

Chrome/Web

https://github.com/Expensify/App/assets/10925636/b0812f12-6f13-413e-8bc6-47722cce4f1f

strepanier03 commented 10 months ago

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

aswin-s commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

situchan commented 10 months ago

Seems like https://github.com/Expensify/App/pull/30955 has been stale for long time. I am not sure we should hold this for that. This issue is never related to emoji.

situchan commented 10 months ago

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

https://github.com/Expensify/App/assets/108292595/607578ee-e049-4a83-b637-2dfc22e84b40

situchan commented 10 months ago

@bernhardoj please do regression test on these issues:

strepanier03 commented 10 months ago

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

bernhardoj commented 10 months ago

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

situchan commented 10 months ago

Remove replaceSelectionWithText after focusing on the composer.

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

bernhardoj commented 10 months ago

It was added since the first time of the feature https://github.com/Expensify/App/pull/21583.

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

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

situchan commented 10 months ago

@bernhardoj's proposal (main solution) looks good to me πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

πŸ“£ @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

melvin-bot[bot] commented 10 months ago

πŸ“£ @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 commented 10 months ago

PR is ready

cc: @situchan

quinthar commented 9 months ago

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 commented 9 months ago

Currently waiting for review. cc: @situchan

situchan commented 9 months ago

Provided feedback. Was testing and finding any possible regressions

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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

If no regressions arise, payment will be issued on 2024-01-31. :confetti_ball:

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

melvin-bot[bot] commented 9 months ago

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:

strepanier03 commented 9 months ago

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 commented 9 months ago

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

strepanier03 commented 9 months ago

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

strepanier03 commented 9 months ago

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