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] [$500] mWeb/Chrome - Compose-After pasting emoji, cursor moving single space away #30983

Closed
1 of 6 tasks
izarutskaya opened this issue Nov 7, 2023 · 26 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 7, 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.3.96-0
Reproducible in staging?: Y
Reproducible in production?: N
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. Go to https://staging.new.expensify.com/
  2. Tap on a report
  3. Search emoji by typing :depa and select it from suggestions
  4. Select and copy the emoji and paste it

Expected Result:

After pasting emoji, cursor must not move single space away.

Actual Result:

After pasting emoji, cursor moving single space away.

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

Bug6266997_1699345284262.space.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015f8946b141752346
  • Upwork Job ID: 1721857426065879040
  • Last Price Increase: 2023-11-07
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment 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 Nov 7, 2023
@melvin-bot melvin-bot bot changed the title mWeb/Chrome - Compose-After pasting emoji, cursor moving single space away [$500] mWeb/Chrome - Compose-After pasting emoji, cursor moving single space away Nov 7, 2023
Copy link

melvin-bot bot commented Nov 7, 2023

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

Copy link

melvin-bot bot commented Nov 7, 2023

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

Copy link

melvin-bot bot commented Nov 7, 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

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

melvin-bot bot commented Nov 7, 2023

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

@izarutskaya
Copy link
Author

Issue is not reproducible in production

Screen_Recording_20231107_135621_Chrome.mp4

@OSBotify
Copy link
Contributor

OSBotify commented Nov 7, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Nov 7, 2023

Triggered auto assignment to @MariaHCD (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@HardikChoudhary24
Copy link
Contributor

HardikChoudhary24 commented Nov 7, 2023

Proposal

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

  • After pasting emoji, cursor moving single space away

What is the root cause of that problem?

  • The root cause of this issue is that we add whitespace after inserting emoji via native keyboard, and we are not checking whether we are entering it manually or directly pasting it.

const isEmojiInserted = diff.length && endIndex > startIndex && EmojiUtils.containsOnlyEmojis(diff);

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

  • To address this problem, we can resolve it by simply checking whether we are pasting a emoji or inserting it manually.
  • This can be done by adding the below code in ComposerWithSuggestion component.
const [isTextPasted,setIsTextPasted] = useState(false);

  • And then passing setIsTextPasted as a prop to the Composer Component.
setIsTextPasted = {()=>setIsTextPasted(true)}
  • And setting the value of isTextNotPasted in the handlePastePlainText function in the composer component.
    const handlePastePlainText = useCallback(
    (event) => {
    const plainText = event.clipboardData.getData('text/plain');
    paste(plainText);
    },
    [paste],
    );
const handlePastePlainText = useCallback(
        (event) => {
            setIsTextPasted();
            const plainText = event.clipboardData.getData('text/plain');
            paste(plainText);
        },
        [paste],
    );

And then adding isTextPasted when we are checking for the inserted text.

const isEmojiInserted = !isTextPasted && diff.length && endIndex > startIndex && EmojiUtils.containsOnlyEmojis(diff) ;
setIsTextPasted(false);

What alternative solutions did you explore? (Optional)
N/A

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 7, 2023

I don't think this should block the deploy. But we can certainly get this fixed.

Thoughts, @alitoshmatov?

@alitoshmatov
Copy link
Contributor

@MariaHCD agree, I think this issue can handled as a regression from #30412

@bondydaa
Copy link
Contributor

bondydaa commented Nov 7, 2023

#23658 (comment)

we're going to revert the PR that caused this

Copy link

melvin-bot bot commented Nov 7, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@bondydaa
Copy link
Contributor

bondydaa commented Nov 7, 2023

revert pr is up #31011

Copy link

melvin-bot bot commented Nov 7, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@bondydaa
Copy link
Contributor

bondydaa commented Nov 7, 2023

revert PR was CP'd to staging, can you please retest to confirm it's fixed?

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 8, 2023

Retested on staging mWeb Chrome and looks good!

XRecorder_08112023_112740.mp4

@MariaHCD MariaHCD closed this as completed Nov 8, 2023
@puneetlath puneetlath removed the DeployBlockerCash This issue or pull request should block deployment label Nov 8, 2023
@puneetlath
Copy link
Contributor

Reopening as we need to pay @alitoshmatov for C+ review

@puneetlath puneetlath reopened this Nov 13, 2023
@alitoshmatov
Copy link
Contributor

PR was deployed to production in 10th November, tomorrow it will be ready for payment

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@alitoshmatov
Copy link
Contributor

We can proceed with payment

@NicMendonca
Copy link
Contributor

@alitoshmatov are you paid via Upwork, or Expensify? If Upwork, can you apply to the job? https://www.upwork.com/jobs/~015f8946b141752346

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Nov 29, 2023

@NicMendonca Upwork, applied

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week)

@alitoshmatov
Copy link
Contributor

@NicMendonca Friendly bump for payment

@NicMendonca NicMendonca changed the title [$500] mWeb/Chrome - Compose-After pasting emoji, cursor moving single space away [HOLD FOR PAYMENT] [$500] mWeb/Chrome - Compose-After pasting emoji, cursor moving single space away Dec 14, 2023
@NicMendonca
Copy link
Contributor

paid!

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. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants