-
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
[VIP-VSB][$500] Chat - Edit mode reopens after sending a message, press Up key and Enter key without delay #31242
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01bb41054c4531b21c |
Triggered auto assignment to @Christinadobrzyn ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
I can only reproduce the issue after dozens of attempts. Is this to be expected? From the attached video, it seemed to be a more common occurrence. |
📣 @Falcowoski! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Hi Team, I've conducted tests to replicate the issue based on the steps provided:
In my tests, I found that the edit mode exits as expected upon pressing Enter without delay. My testing was conducted on the MacOS: Chrome browser. Please let me know if there are additional steps or conditions I should consider. |
📣 @favourch! 📣
|
|
1 similar comment
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Hi Team, I've conducted tests to replicate the issue based on the steps provided:
In my tests, I found that the edit mode exits as expected upon pressing Enter without delay. My testing was conducted on the MacOS: Chrome browser. Please let me know if there are additional steps or conditions I should consider. |
ProposalPlease re-state the problem that we are trying to solve in this issue.When editing a message in a short space of time, the editing mode is exited as expected, but unwantedly, it is started again without any interaction on the part of the user. In addition, the text displayed is not the newly edited text, but the original text. What is the root cause of that problem?The root cause of the problem is the invocation of the To be exact, there is a problem before that. In my opinion, there is no need to invoke the above function when mounting the component, because we are already setting the initial value of the "state" Of course, I'm aware that the Returning to the root cause, it's very complicated to replicate the error in most cases, because we need to get the "timing" right! We must edit the message and save it before the In addition to all this, it seems that the flowchart TB
A[Send message] --> B[Open edit mode with Up key]
B -->|handleKeyDown| C[Invoke `saveReportActionDraft`]
C -->|Set `draftMessage` value to last message| D[Mount `ReportActionItemMessageEdit`]
D --> E[Run `preferredLocale` useEffect]
E --> F[Invoke `updateDraft`]
F -->|User add a new character| G[Invoke `triggerSaveOrCancel`]
G -->|User press Enter key| H[Invoke `triggerSaveOrCancel` again]
H --> I[Invoke `publishDraft`]
I --> J[Invoke `editReportComment`]
J --> K[Invoke `deleteDraft`]
K -->|Set `draftMessage` value to empty string| L[Unmount `ReportActionItemMessageEdit`]
L --> M[Close edit mode]
M -->|`updateDraft` execute debounced callback| N[Set `draftMessage` to last original message]
N -->|Mount `ReportActionItemMessageEdit`| O[Open edit mode]
What changes do you think we should make in order to solve the problem?A. Skip "setState" when it is first renderedPrevent the invocation of I accept ideas for other ways to "validate" whether or not we're at the first rendering! We won't have any problems with the button opening the edit mode, as it also has a "setDraft" before the component is mounted, via What alternative solutions did you explore?B. Fix cancel methodUnderstand why the C. "New" cancel methodAdd another way to cancel the execution of the callback. So far, in this option, the only information I have is the place where we should cancel the execution, which is inside the D. Replace debounced invocationReplace |
Proposal |
ProposalPlease re-state the problem that we are trying to solve in this issue.When quickly editing, then hitting enter in a previous chat message, the edit dialog is re-opening and saved changes are lost What is the root cause of that problem?The root cause is that What changes do you think we should make in order to solve the problem?We need to make sure to always cancel our previous debounced handlers before we call them again. In some scenarios it may be okay to let debounces stack, but in this case it's causing a race condition. NoteMy apologies for not originally using the proposal template, and also for preemptively posting a PR. It's my first day attempting to contribute to this lovely code base and there was lots to learn in the docs. |
📣 @ericuldall! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Thanks for your elaborate proposal @Falcowoski. It seems like to me that the real reason why this is not working is that the cancel method is broken. Do you mind explaining what's wrong with it and how we can fix it? |
Hi, @allroundexperts! I do some extensive searches in this subject and sincerely, to me, is the most common issue possible: The function reference was changed/updated and the I'm aware that we are wrapping the debounced function in a I was thinking in focus in the What do you think? debouncedSaveDraft
deleteDraftThe
|
Still working through proposals |
I'm back from ooo - Let us know if there are any updates on the proposal review @allroundexperts! |
@allroundexperts can you let us know if any of these proposals look good? Thanks! |
DMd @allroundexperts and they are reviewing the proposals |
Just tested this again on latest main and I am not able to reproduce this any longer. @Falcowoski Can you confirm if this is still happening for you? |
Just re-tested this too and I think it's resolved also. It seems like when you click the up-arrow the previous message is reopened to be edited and when you press enter the message closes. I think this is working as expected. @Falcowoski how does it look for you? |
Sorry for the delay! I just tested it a few times and unfortunately I replicated the issue, which is the editing menu opening automatically. I tested in new.expensify.com |
Ah so the OP is wrong - it should be the following - is this correct @Falcowoski? Expected Result:The text can't be edited Actual Result:The text is reopening to edit mode |
Hmmmm, in my opinion, the expected result is the message being updated and the edit mode not opening again, like in the OP Today, the edit mode opens again when updating the message very quick. Maybe I didn't understand the question well. Sorry |
Awesome, that does help @Falcowoski! Thanks! |
@allroundexperts were you able to test this based on the updated steps in the OP? I think this might be part of the vip-vsb project so asking the team for their thoughts - https://expensify.slack.com/archives/C066HJM2CAZ/p1703028537544869 |
I think we can move forward with reviewing proposals @allroundexperts! |
@allroundexperts, @Christinadobrzyn Eep! 4 days overdue now. Issues have feelings too... |
1 similar comment
@allroundexperts, @Christinadobrzyn Eep! 4 days overdue now. Issues have feelings too... |
@allroundexperts, @Christinadobrzyn 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
hi @allroundexperts can you provide an update on this? |
Hi @Christinadobrzyn! |
I can't reproduce this either, I'm not sure if this is resolved but I also think it might be a low priority anyway. I think we should just close this for the time being as it's difficult to understand what the issue actually is. |
Issue is still reproducible on the latest build 1.4.26-1 bandicam.2024-01-17.22-45-35-936.mp4 |
yes this feels too esoteric for right now, closing. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.98-3
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
expected result is the message being updated and the edit mode not opening again
Actual Result:
The exit mode reopens
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6273002_1699751562246.20231112_091028.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: