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 2023-10-30] [HOLD for payment 2023-10-27] [$250] Chat - First row emojis are skipped #30083

Closed
4 of 6 tasks
kbecciv opened this issue Oct 20, 2023 · 29 comments
Closed
4 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Oct 20, 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.87.8
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:@s-alves10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697753213411739

Action Performed:

  1. Open ND and log in with any account
  2. Open any chat and tap emoji button in the main composer to open EmojiPicker
  3. Type any characters in search input(for example, he)
  4. Press arrow down key several times and try to highlight first row emojis by pressing arrow down or arrow left keys
  5. Verify that first row emojis are skipped

Expected Result:

First row emojis can be highlighted by arrow keys

Actual Result:

First row emojis are skipped

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

Android: Native
Android: mWeb Chrome
android_chrome.1.mp4
iOS: Native
iOS: mWeb Safari
ios_safari.1.mp4
MacOS: Chrome / Safari
mac_chrome.mp4
Recording.5093.mp4
MacOS: Desktop
mac_desktop.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ed51d25e4548ec9f
  • Upwork Job ID: 1715386754082848768
  • Last Price Increase: 2023-10-20
  • Automatic offers:
    • fedirjh | Reviewer | 27296434
    • s-alves10 | Contributor | 27296440
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Oct 20, 2023
@OSBotify
Copy link
Contributor

👋 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.

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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

@s-alves10
Copy link
Contributor

Proposal

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

Can't highlight first row emojis by arrow keys when searching emojis in Emoji Picker

What is the root cause of that problem?

When moving highlight by arrow keys, we check the bound by the following code

() => highlightedIndex - 1 < firstNonHeaderIndex.current,

() => highlightedIndex - CONST.EMOJI_NUM_PER_ROW < firstNonHeaderIndex.current,

When searching emojis, firstNonHeaderIndex.current should be 0 because there are no spaces or headers.
But this value is updated by
useEffect(() => {
// This callback prop is used by the parent component using the constructor to
// get a ref to the inner textInput element e.g. if we do
// <constructor ref={el => this.textInput = el} /> this will not
// return a ref to the component, but rather the HTML element by default
if (shouldFocusInputOnScreenFocus && forwardedRef && _.isFunction(forwardedRef)) {
forwardedRef(searchInputRef.current);
}
setupEventHandlers();
updateFirstNonHeaderIndex(emojis.current);
return () => {
cleanupEventHandlers();
};
}, [forwardedRef, shouldFocusInputOnScreenFocus, cleanupEventHandlers, setupEventHandlers]);
every time its dependency changes
updateFirstNonHeaderIndex(emojis.current);

That is, updateFirstNonHeaderIndex function is called with the entire emojis every time highlight index is changed. So the value of firstNonHeaderIndex.current becomes 8
This is the root cause

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

updateFirstNonHeaderIndex function should be called with the entire emojis only on mount and when search input is empty.
We do this when search input is empty here

updateFirstNonHeaderIndex(emojis.current);

Remove this line and call the function on mount

    useEffect(() => {
        updateFirstNonHeaderIndex(emojis.current);
    }, []);

This works as expected

What alternative solutions did you explore? (Optional)

@kbecciv
Copy link
Author

kbecciv commented Oct 20, 2023

Proposal by:@s-alves10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697753213411739

Proposal

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

Can't highlight first row emojis by arrow keys when searching emojis in Emoji Picker

What is the root cause of that problem?

When moving highlight by arrow keys, we check the bound by the following code

() => highlightedIndex - 1 < firstNonHeaderIndex.current,

() => highlightedIndex - CONST.EMOJI_NUM_PER_ROW < firstNonHeaderIndex.current,

When searching emojis, firstNonHeaderIndex.current should be 0 because there are no spaces or headers.
But this value is updated by
useEffect(() => {
// This callback prop is used by the parent component using the constructor to
// get a ref to the inner textInput element e.g. if we do
// <constructor ref={el => this.textInput = el} /> this will not
// return a ref to the component, but rather the HTML element by default
if (shouldFocusInputOnScreenFocus && forwardedRef && _.isFunction(forwardedRef)) {
forwardedRef(searchInputRef.current);
}
setupEventHandlers();
updateFirstNonHeaderIndex(emojis.current);
return () => {
cleanupEventHandlers();
};
}, [forwardedRef, shouldFocusInputOnScreenFocus, cleanupEventHandlers, setupEventHandlers]);
every time its dependency changes
updateFirstNonHeaderIndex(emojis.current);

That is, updateFirstNonHeaderIndex function is called with the entire emojis every time highlight index is changed. So the value of firstNonHeaderIndex.current becomes 8
This is the root cause

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

updateFirstNonHeaderIndex function should be called with the entire emojis only on mount and when search input is empty.
We do this when search input is empty here

updateFirstNonHeaderIndex(emojis.current);

Remove this line and call the function on mount

    useEffect(() => {
        updateFirstNonHeaderIndex(emojis.current);
    }, []);

This works as expected

What alternative solutions did you explore? (Optional)

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Oct 20, 2023
@melvin-bot melvin-bot bot changed the title Chat - First row emojis are skipped [$500] Chat - First row emojis are skipped Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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

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

melvin-bot bot commented Oct 20, 2023

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

@mountiny mountiny changed the title [$500] Chat - First row emojis are skipped [$250] Chat - First row emojis are skipped Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

Upwork job price has been updated to $250

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

melvin-bot bot commented Oct 20, 2023

📣 @fedirjh 🎉 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
Copy link

melvin-bot bot commented Oct 20, 2023

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

@mountiny
Copy link
Contributor

Lowering the amount since this is lower value bug and accessibility feature as well which we dont technically support yet

@ghost
Copy link

ghost commented Oct 20, 2023

Dibs

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Oct 20, 2023
@s-alves10
Copy link
Contributor

@fedirjh

PR is ready for review #30092

@situchan
Copy link
Contributor

@s-alves10 what's offending PR?

@s-alves10
Copy link
Contributor

Looks like #29241 is related

@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 20, 2023
@melvin-bot melvin-bot bot changed the title [$250] Chat - First row emojis are skipped [HOLD for payment 2023-10-27] [$250] Chat - First row emojis are skipped Oct 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

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

@melvin-bot

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-27] [$250] Chat - First row emojis are skipped [HOLD for payment 2023-10-30] [HOLD for payment 2023-10-27] [$250] Chat - First row emojis are skipped Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 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 2023-10-30. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@fedirjh
Copy link
Contributor

fedirjh commented Oct 26, 2023

BugZero Checklist:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@AndrewGable, @fedirjh, @s-alves10 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@AndrewGable AndrewGable added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 31, 2023
Copy link

melvin-bot bot commented Oct 31, 2023

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

This comment was marked as duplicate.

@AndrewGable
Copy link
Contributor

@joekaufmanexpensify - Can you pay out? Thanks

@joekaufmanexpensify
Copy link
Contributor

Sure!

@joekaufmanexpensify
Copy link
Contributor

This PR qualified for a speed bonus, this means we need to make the following payments:

  • @s-alves10 - $425 ($250 for PR + $125 speed bonus + $50 for reporting the bug). Paid via Upwork.
  • @fedirjh - $375 ($250 for C+ review + $125 speed bonus). Paid via Upwork.

@joekaufmanexpensify
Copy link
Contributor

@s-alves10 $425 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@fedirjh $375 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed.

@joekaufmanexpensify
Copy link
Contributor

Closing as this is all set. 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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants