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 2023-08-01] [$1000] The emoji picker does not close when UserA deletes the message that UserB is in the process of editing #22214
Switch back to UserA's account and delete the message sent by UserB
Expected Result:
The emoji picker should close when UserA deletes the message that UserB is editing
Actual Result:
The emoji picker does not close when UserA deletes the message that UserB is in the process of editing
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.36-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 Notes/Photos/Videos: Any additional supporting documentation
Please re-state the problem that we are trying to solve in this issue.
The emoji picker remains open when UserA deletes the message that UserB is editing
What is the root cause of that problem?
The emoji picker should close if the message has been deleted or for a different reason is no longer in edit mode, for example if edit mode was exited via a different tab/window (same account)
What changes do you think we should make in order to solve the problem?
In the ReportActionItemMessageEdit component, an unmount should be detected and this should call hideEmojiPicker() (EmojiPickerAction.js), but only if the emoji picker actually belongs to this message, which can be checked using the isActiveReportAction method (EmojiPickerAction.js)
To correctly identify the initiating reportAction for the emoji picker (which is currently not stored), we must pass the reportAction. This will prevent the emoji picker from being closed if it's initiated elsewhere, for example the new message composer or via editing a different message.
To accomplish this, the reportAction prop should be created and props.action should be passed in EmojiPickerButton:
Please re-state the problem that we are trying to solve in this issue.
The emoji picker does not close when UserA deletes the message that UserB is in the process of editing
What is the root cause of that problem?
In the ReportActionItem component, we already have logic so that when a report action item is unmounted (or removed), it will hide the EmojiPicker if this condition EmojiPickerAction.isActiveReportAction(props.action.reportActionID) is true (line 123)
It works well if we open EmojiPicker by clicking on either the context menu or the report item reactions menu. But when we click on the Emoji button in the right hand of edit message composer, it won't work because we haven't passed the reportAction when click on that emoji button yet
What changes do you think we should make in order to solve the problem?
The EmojiPickerButton component originally used in the main composer, but we would like to use it in the edit composer as well. So I think we need to update it a little bit in this case.
More details, we should apply what we did regarding showing EmojiPicker in the MiniQuickEmojiReactions component for EmojiPickerButton component, that means:
In the ReportActionItemMessageEdit, we should pass the prop reportAction={props.action} to the EmojiPickerButton here, same as we did when open in the context menu here
Activity
melvin-bot commentedon Jul 4, 2023
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 4, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)samh-nl commentedon Jul 4, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The emoji picker remains open when UserA deletes the message that UserB is editing
What is the root cause of that problem?
The emoji picker should close if the message has been deleted or for a different reason is no longer in edit mode, for example if edit mode was exited via a different tab/window (same account)
What changes do you think we should make in order to solve the problem?
In the
ReportActionItemMessageEditcomponent, an unmount should be detected and this should callhideEmojiPicker()(EmojiPickerAction.js), but only if the emoji picker actually belongs to this message, which can be checked using theisActiveReportActionmethod (EmojiPickerAction.js)To correctly identify the initiating reportAction for the emoji picker (which is currently not stored), we must pass the reportAction. This will prevent the emoji picker from being closed if it's initiated elsewhere, for example the new message composer or via editing a different message.
To accomplish this, the
reportActionprop should be created andprops.actionshould be passed inEmojiPickerButton:App/src/pages/home/report/ReportActionItemMessageEdit.js
Lines 326 to 331 in 7e908b1
Next, the
reportActionprop should be passed in theEmojiPickerAction.showEmojiPickercall:App/src/components/EmojiPicker/EmojiPickerButton.js
Line 36 in 7e908b1
What alternative solutions did you explore? (Optional)
N/A
hoangzinh commentedon Jul 7, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The emoji picker does not close when UserA deletes the message that UserB is in the process of editing
What is the root cause of that problem?
In the
ReportActionItemcomponent, we already have logic so that when a report action item is unmounted (or removed), it will hide the EmojiPicker if this conditionEmojiPickerAction.isActiveReportAction(props.action.reportActionID)is true (line 123)App/src/pages/home/report/ReportActionItem.js
Lines 114 to 128 in 0ee7dfa
It works well if we open
EmojiPickerby clicking on either the context menu or the report item reactions menu. But when we click on the Emoji button in the right hand of edit message composer, it won't work because we haven't passed thereportActionwhen click on that emoji button yetApp/src/components/EmojiPicker/EmojiPickerButton.js
Line 36 in 0ee7dfa
Thus, we can't store the current reportAction in this case => It leads to above condition returns false => it won't work properly.
What changes do you think we should make in order to solve the problem?
The
EmojiPickerButtoncomponent originally used in the main composer, but we would like to use it in the edit composer as well. So I think we need to update it a little bit in this case.More details, we should apply what we did regarding showing EmojiPicker in the
MiniQuickEmojiReactionscomponent forEmojiPickerButtoncomponent, that means:ReportActionItemMessageEdit, we should pass the propreportAction={props.action}to the EmojiPickerButton here, same as we did when open in the context menu hereprops.reportActionabove as we did inside MiniQuickEmojiReactions hereanmurali commentedon Jul 7, 2023
I am not sure how user A can delete user B's message in a room. I don't see that option at all.

hoangzinh commentedon Jul 8, 2023
@anmurali user A must be an admin for that room. Or user B is logging in another device, delete his message.
anmurali commentedon Jul 10, 2023
Ah gotcha!
45 remaining items
anmurali commentedon Aug 15, 2023
ayazhussain79 commentedon Aug 15, 2023
@anmurali offer accepted, Thank you
allroundexperts commentedon Aug 15, 2023
Requested the ND payment.
JmillsExpensify commentedon Aug 15, 2023
Reviewed the details for @allroundexperts. Approved for payment in NewDot based on the BZ summary above.
melvin-bot commentedon Aug 21, 2023
@hoangzinh, @anmurali, @allroundexperts, @marcaaron Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Aug 21, 2023
@hoangzinh, @anmurali, @allroundexperts, @marcaaron Eep! 4 days overdue now. Issues have feelings too...
marcaaron commentedon Aug 22, 2023
Anything left to do for this one?
hoangzinh commentedon Aug 23, 2023
@marcaaron Nope, I think we can close this issue.
marcaaron commentedon Aug 24, 2023
Thanks !
ayazhussain79 commentedon Oct 23, 2023
@anmurali Could you please end the contract of this bug job on upwork
ayazhussain79 commentedon Oct 26, 2023
@anmurali Kindly close the job on Upwork, it's still in progress