-
Notifications
You must be signed in to change notification settings - Fork 3k
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-09-12] [$1000] Compose Box - User able to select 2 emoji at a time #24261
Comments
Triggered auto assignment to @lschurr ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.A user is able to select and send 2 emojis at the same time before the emoji picker closes. What is the root cause of that problem?After the user selects an emoji, the other emojis can still accept touch or press input during the brief period while the emoji picker is still open. Since the other emojis can still accept touch or press input, the
What changes do you think we should make in order to solve the problem?Since this happens on iOS and Android native (all web platforms and desktop are fine), only Solution 1
Solution 2 What alternative solutions did you explore? (Optional)I tried to use a state variable to track the emoji picked boolean flag, but it is possible for a user to tap fast enough to send a subsequent |
Job added to Upwork: https://www.upwork.com/jobs/~01d67b0c351a8b8c5d |
Current assignee @lschurr is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.A user is able to select 2 emojis at the same time before the emoji picker closes. What is the root cause of that problem?App/src/components/EmojiPicker/EmojiPickerMenu/index.native.js Lines 91 to 95 in 0f83752
The It is also possible to add more than 2 emojis if the device is slow enough. What changes do you think we should make in order to solve the problem?
Check if What alternative solutions did you explore? (Optional)N/A Note: I edited this proposal, since my first proposal was not tested. The new one is tested and confirmed that it works. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The user is allowed to select 2 emojis at a time. What is the root cause of that problem?In here
onPress will be triggered multiple times, causing many emojis to be selected.
What changes do you think we should make in order to solve the problem?We need to prevent selection of emojis if the last emoji selection didn't finish executing. After this issue is fixed, we'll have a Then we can use that hook to wrap the callback here
There'll be small changes needed in that
and
Then it will be a 1-liner change in here:
and it uses a general approach that's also used in other places in the app ( What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?I have three solutions:
What alternative solutions did you explore? (Optional)
|
Proposal What is the root cause of that problem? [App/src/components/EmojiPicker/EmojiPicker.js] Line 98
What changes do you think we should make in order to solve the problem? Solution video demo, I tested it on android, it works fine, after the user click the emoji, the modal hides then, and the user has no way to select two or more emoji at one time. If I have been chosen, kindly let me know, the project is great, I see only Android is checked, if it requires all platform demo, I will upload the demos later, and PR later. Contributor details |
📣 @gzqyl! 📣
|
Contributor details |
@robertKozik could you review these proposals? |
Bumped in Slack as well - https://expensify.slack.com/archives/C01GTK53T8Q/p1691770938283059 |
Thank you all for your proposals! 🙇🏼 @jeet-dhandha - using debounce is almost the same as @gzqyl - Your proposal lacks explanation of the solution. I cannot tell from your comment whether or not your solution is better/worst than others as you just include the video of the working solution @akinwale & @Fabb111 both your solutions are quite similar - they're just using the different refs to detect whether or not modal will be soon closed. But even though this approach would be successful I believe that it's not tackling the root cause directly - which is that user can click multiple times before modal close. We are just ensuring that only the first would be handled (I'm aware that it means exactly the same as prohibiting multiple clicks, but the approach suggested by @tienifr will be the better option, as it can be used in multiple places and standardise the approach to such a cases across the app) @tienifr implementing and standardising on one function for prohibiting multiple function calls is the way to go in my opinion. It tackles the problem at it roots removing to call function multiple times This said I believe that proposal from @tienifr is the way to go here, so we would have the same approach ( Selected Proposal: Proposal 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Okay @robertKozik. Keep up the Good Work @tienifr 🥂. |
@robertKozik the solution chosen looks very good, while I had tested it just now, it seems the bug still occurs, I understand that the video I uploaded is a little hard to check whether it works or not, as when the user clicks slower, the bug will not occur. |
Yeah, it seems it is very possible for a user to be able to click faster than the state updates, since React state updates are not immediate. Using a ref would be a better solution in that regard. |
@robertKozik @tienifr Tried cc632d9c-cb74-4533-b8cc-4ee401eacc75.mp4 |
I understand what you are talking about, but states and refs are two very basic things in React and it is common knowledge for everyone who calls themselves React developer. Obviously @tienifr could have looked in the first proposal, or I even wrote
The original proposal had another purpose, and the purpose was adapted with a common concept (state + ref combined) after it was pointed out that the original variant wouldn’t exactly work here. |
Also this is more of a major code change instead of fixing the underlying issue. |
What I could not accept is that @tienifr ’s workable solution was posted after my workable codes posted. |
the PR is ready for review #24614 |
@robertKozik Waiting for a response... |
Bump @marcochavezf. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.63-2 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-09-12. 🎊 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.
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:
|
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:
|
@robertKozik 😭 😭 Just once look at the comment #24261 (comment) |
@robertKozik could you work on the checklist for this one? Do we need a regression test? |
Payment summary:
|
CC. @lschurr |
Great, this one is all set. Closing. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The user should be able to select only one emoji at a time
Actual Result:
The user is allowed to select 2 emojis at a time
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.51.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
Bug6157001_twoemojiusethis.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: