You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-06-11] [$250] Chat - Emoji is deleted if entered quickly after some text #41778
changed the title [-]Chat - Emoji is deleted if entered quickly after some text[/-][+][$250] Chat - Emoji is deleted if entered quickly after some text[/+]on May 7, 2024
Please re-state the problem that we are trying to solve in this issue.
When you enter some text (it can also be space in the end) and then insert an emoji in less than a second after finishing typing, the emoji is being removed. This also can be reproduced in any other platform, just be quick.
What is the root cause of that problem?
In "ComposerWithSuggestions" component "updateComment" function a comment update with regular text is saved with the debounced function, while comment update with emoji is not. So what happens is first the comment with the emoji is being saved and then the debounced function is being invoked with the old value, reverting the comment to the previous non-emoji state.
What changes do you think we should make in order to solve the problem?
There are two way to solve this issue.
Either adding debouncedSaveReportComment.flush() line of code when updating the comment with the emoji in "updateComment" function. This will invoke the debounced function before the emoji insertion.
Or save emoji with debounced function. So updateComment(ComposerUtils.insertText(commentRef.current, selection, text), true); in "replaceSelectionWithText" function. This will update the debounced function and invoke it with the correct value.
What alternative solutions did you explore? (Optional)
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: N/A
Determine if we should create a regression test for this bug: Yes
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.
Regression test:
Open any chat.
Type some text.
Quickly insert some emoji with the help of the app's emoji picker.
Verify the emoji is not deleted after that.
Do we 👍 or 👎 ?
It is not mine, it is my brother's, I need to prepare my documents to verify my upwork. If it needs to be my upwork, can I send it in the next two weeks?
Activity
melvin-bot commentedon May 7, 2024
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.izarutskaya commentedon May 7, 2024
We think this issue might be related to the #vip-vsb.
trjExpensify commentedon May 7, 2024
I can reproduce this. You have to add the emoji to the end of the text with no space for it to disappear.
[-]Chat - Emoji is deleted if entered quickly after some text[/-][+][$250] Chat - Emoji is deleted if entered quickly after some text[/+]melvin-bot commentedon May 7, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01f96963f235e9c546
melvin-bot commentedon May 7, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)roitman-g commentedon May 9, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
When you enter some text (it can also be space in the end) and then insert an emoji in less than a second after finishing typing, the emoji is being removed. This also can be reproduced in any other platform, just be quick.
What is the root cause of that problem?
In "ComposerWithSuggestions" component "updateComment" function a comment update with regular text is saved with the debounced function, while comment update with emoji is not. So what happens is first the comment with the emoji is being saved and then the debounced function is being invoked with the old value, reverting the comment to the previous non-emoji state.
What changes do you think we should make in order to solve the problem?
There are two way to solve this issue.
debouncedSaveReportComment.flush()line of code when updating the comment with the emoji in "updateComment" function. This will invoke the debounced function before the emoji insertion.updateComment(ComposerUtils.insertText(commentRef.current, selection, text), true);in "replaceSelectionWithText" function. This will update the debounced function and invoke it with the correct value.What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon May 10, 2024
@trjExpensify, @hungvu193 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
35 remaining items
hungvu193 commentedon Jun 11, 2024
Regression test:
Do we 👍 or 👎 ?
trjExpensify commentedon Jun 11, 2024
Thanks, @hungvu193! I don't think we need a standalone regression test for this, it was caught while executing an existing one as per the OP link.
Payment summary as follows:
Hans is paid. @roitman-g, can you send me your Upwork profile please?
hungvu193 commentedon Jun 11, 2024
@trjExpensify can you check upwork again? I think contract was ended without payment

roitman-g commentedon Jun 12, 2024
May I use this upwork account for this - https://www.upwork.com/freelancers/~0197cfa7f554b66970?
trjExpensify commentedon Jun 13, 2024
@hungvu193 looks paid to me:
Yeah @roitman-g, if that's your Upwork profile? 😕
iwiznia commentedon Jun 17, 2024
Anything else to do here?
trjExpensify commentedon Jun 18, 2024
@roitman-g can you confirm on this?
roitman-g commentedon Jun 19, 2024
It is not mine, it is my brother's, I need to prepare my documents to verify my upwork. If it needs to be my upwork, can I send it in the next two weeks?
trjExpensify commentedon Jun 19, 2024
Sounds good, @roitman-g. I've sent an offer to that Upwork profile. Please accept and then I'll pay and close this issue out.
trjExpensify commentedon Jun 20, 2024
Paid, closing!