-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-04-15] [$500] Characters missing when typing message in compose box #37356
Comments
Triggered auto assignment to @johncschuster ( |
@johncschuster, I'll take this, I have context from the issue this came form, and the bug. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Characters missing when typing message in compose box What is the root cause of that problem?Race conditions occur when updating the composer value by typing and updating the value from the Onyx draft. In the main composer, the App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 34 to 36 in b7a230e
When editing chat, this is the culprit that causes it to behave similarly to the main composer. App/src/pages/home/report/ReportActionItemMessageEdit.tsx Lines 129 to 131 in b7a230e
The problem is that when typing a comment, the value from the composer will be more recent than the updates above, which means the above updates might use outdated value. What changes do you think we should make in order to solve the problem?Ensure the updated value is not outdated by using Composer's most recent value when the user is actively typing.
In
Pass the
and use
When editing
Trigger the typing tracking here.
Or perform early return when isTypingRef.current === true What alternative solutions did you explore? (Optional)Alternative 1We can remove the GMT20240229-024116_Clip_Wildan.M.s.Clip.02_29_2024.mp4Alternative 2What if we set the It means the debounced function will be invoked immediately when the event occurs, and then it will be debounced for subsequent calls. It will not miss a keystroke, but the onyx The issue illustrated in this video GMT20240229-031351_Clip_Wildan.M.s.Clip.02_29_2024.mp4Better solution We can trigger the Change this lines: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 322 to 328 in 3e74ddf
To
Also implement this modification in src/pages/home/report/ReportActionItemMessageEdit.tsx for Test with 'JUMP' at 1-second typing interval. GMT20240229-023310_Clip_Wildan.M.s.Clip.02_29_2024.mp4Test with paragraph at 100 millisecond typing interval GMT20240229-022734_Clip_Wildan.M.s.Clip.02_29_2024.mp4 |
I would like to explain why your solution seems fail to reproduce, but not mitigate the bug: Specifically note from the docs the following: If you type 1 character per second, and the wait is 1 second, it will now never call the debounce. I think we see a few of those occurrences in your video. If we review this report https://ellenaua.medium.com/throttle-debounce-behavior-lodash-6bcae1494e03 it shows how the debounce also now no longer reliable runs at the 1 second interval as is required to actually reproduce the bug with the script. |
@jeremy-croff Thanks for your comment. To help readers stay focused, I filter my console log with the 'wildebug' keyword. This is my personal debug code. |
Thank you and my apologies, I edited my wording a bit in the same train of thought. I also deleted my original proposal and have a new one to consider: ProposalPlease re-state the problem that we are trying to solve in this issue.We are missing characters when typing What is the root cause of that problem?
These three compete with what's on the screen, what should get debounced, and what's in the store. To reproduce the bug, we we maximize the draft saving lifecycles, to trigger rerenders, which occur each time you wait >1 sec because the debounce, Let's say you type a character before that change is reflected on the input 1. a debounce will save it, but it gets wiped while it repaints from onyx. And after the repaint 2. changeText is detected and now the debounce will just simply save the text with the missing character. I was able to isolate the related code early on here in the original thread. What changes do you think we should make in order to solve the problem?When reviewing a solution, I wanted to decouples these 3 factors,
|
Job added to Upwork: https://www.upwork.com/jobs/~0104493dfd4225a65e |
Triggered auto assignment to Contributor Plus for review of internal employee PR - @sobitneupane ( |
@getusha , can you please review the above proposals? Assigning to you since you're also on the issue for documenting reproducible steps. @sobitneupane , sorry about adding you by mistake via the |
Thanks @mallenexpensify, |
@jeremy-croff thanks for the proposal, could you add a little more details to the solution you're proposing? |
I would add and delete this line: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 429 in 780e2ac
And the existing useMemo callback: here App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 322 in 780e2ac
We already are saving the text input in this line here to the state: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 403 in 780e2ac
So we would be responding to the state variable changing, not the callback from user typing. Is that enough detail? |
@getusha can you please respond to @jeremy-croff 's post above? Thx |
@jeremy-croff it is not clear how you plan to pass |
ReportId is available in the scope as a component prop |
|
Added to #vip-vsb room. |
@getusha , 👀 plz on @jeremy-croff 's comment above. I'd love to get this resolved soon, if only cuz I personally run in it semi-frequently. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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 2024-04-15. 🎊 For reference, here are some details about the assignees on this 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:
|
Contributor: @tienifr paid $500 via Upwork I created the TestRail GH with the test steps below from the PR, comment if there are better steps. @getusha, please complete the rest of the BZ checklist above. thx Tests
|
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: [@getusha] The PR that introduced the bug has been identified. Link to the PR: #25758 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Coming from here where we were able to document reliable reproduction steps.
Version Number:
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
Expensify/Expensify Issue URL:
Issue reported by: @mallenexpensify
Slack conversation: here
Reproduction Steps
Expected result:
The word 'JUMP' needs to be typed with consistency in the composer. ignore the first word it is because we had a delay when focusing the input.
Actual result:
After a few tries character gets omitted and the word becomes inconsistent. i.e.
JUMP JUMP JMP
Screen.Recording.2024-02-22.at.11.35.41.AM.mov
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
View the other issue.
Additional Deliverable
From here
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: