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
"User is typing..." will appear briefly when the other user leaves and returns to the chat. #25551
Login with 2 users ( User A and User B ) in front of you at the same time.
Open the chat room between the two users.
As User A start Typing in the composer > then leave the room ( with text in the composer ) to any other room > Then return to the room again.
Now notice User B.
Expected Result:
"User A is typing..." shouldn't appear for user B. Because User A isn't actually Typing, He just left the chat and then returned.
Actual Result:
When User A leaves and returns to the chat, "User A is typing..." briefly appears for User B.
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.55-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
In updateComment, we always display "user typing ..." if newComment is not empty. Because the draft message is not empty, when we return the chat, "user typing ..." appear briefly.
When return to the room that has draft message, ReportActionCompose component’s updateComment method is not checking whether its new message or from draft message.
What changes do you think we should make in order to solve the problem?
Please re-state the problem that we are trying to solve in this issue.
“User is typing...” will appear briefly when the other user leaves and returns to the chat.
What is the root cause of that problem?
When user leaves and comebacks to the chat, the below line will pass the condition if !!newComment is true so it always call "debouncedBroadcastUserIsTyping" function
Please re-state the problem that we are trying to solve in this issue.
Revisit a chat with a draft will broadcast "user typing" to the user.
What is the root cause of that problem?
When the component is mounted, we will call updateComment, and inside updateComment, we will broadcast the "user typing" if the comment/text is not empty.
Because of this difference, we call updateComment on composer mount.
What changes do you think we should make in order to solve the problem?
updateComment do other things besides updating isCommentEmpty so we shouldn't use it to update isCommentEmpty correctly. I see this as a workaround. Instead, we should correctly initialize isCommentEmpty by using the same condition.
Activity
dukenv0307 commentedon Aug 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
"User is typing..." will appear briefly when the other user leaves and returns to the chat.
What is the root cause of that problem?
When we return the chat,
componentDidMountofReportActionComposeis triggered and in this function, we callupdateCommentfunction.App/src/pages/home/report/ReportActionCompose.js
Line 802 in d6a14d7
In
updateComment, we always display "user typing ..." ifnewCommentis not empty. Because the draft message is not empty, when we return the chat, "user typing ..." appear briefly.App/src/pages/home/report/ReportActionCompose.js
Lines 841 to 843 in d6a14d7
What changes do you think we should make in order to solve the problem?
We should check if the current value state and
newCommentis equal which means this is the draft message, we will not display user is typingApp/src/pages/home/report/ReportActionCompose.js
Lines 841 to 843 in d6a14d7
What alternative solutions did you explore? (Optional)
NA
Result
Screencast.from.10-08-2023.10.45.09.webm
melvin-bot commentedon Aug 20, 2023
Triggered auto assignment to @joekaufmanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 20, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jfquevedol2198 commentedon Aug 20, 2023
This was proposed on 11 days ago on Slack channel
Proposal
Please re-state the problem that we are trying to solve in this issue.
“User is typing...” will appear briefly when the other user leaves and returns to the chat.
What is the root cause of that problem?
App/src/pages/home/report/ReportActionCompose.js
Lines 841 to 843 in 58dc0c9
When return to the room that has draft message, ReportActionCompose component’s updateComment method is not checking whether its new message or from draft message.
What changes do you think we should make in order to solve the problem?
Update this line like following:
What alternative solutions did you explore? (Optional)
N/A
Ahmed-Abdella commentedon Aug 21, 2023
@kavimuru hey kavi, you uploaded the wrong video, the first video in the issue is not the bug video. This is the video
DylanDylann commentedon Aug 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
“User is typing...” will appear briefly when the other user leaves and returns to the chat.
What is the root cause of that problem?
When user leaves and comebacks to the chat, the below line will pass the condition if !!newComment is true so it always call "debouncedBroadcastUserIsTyping" function
App/src/pages/home/report/ReportActionCompose.js
Lines 841 to 843 in 58dc0c9
What changes do you think we should make in order to solve the problem?
App/src/pages/home/report/ReportActionCompose.js
Line 802 in 58dc0c9
rather than
App/src/pages/home/report/ReportActionCompose.js
Line 257 in 58dc0c9
What alternative solutions did you explore? (Optional)
N/A
Result
Screencast.from.18-08-2023.16.03.34.webm
bernhardoj commentedon Aug 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Revisit a chat with a draft will broadcast "user typing" to the user.
What is the root cause of that problem?
When the component is mounted, we will call
updateComment, and insideupdateComment, we will broadcast the "user typing" if the comment/text is not empty.App/src/pages/home/report/ReportActionCompose.js
Lines 416 to 418 in 64ecc7a
This logic (calling

updateCommenton mount) is introduced in this PR to set the initialisCommentEmptystate correctly.Currently, the initial value of
isCommentEmptytaking spaces into account (is considered not empty),App/src/pages/home/report/ReportActionCompose.js
Line 283 in 64ecc7a
but
updateCommentwill setisCommentEmptyto true only if the value contains at least one non-space character (is considered empty).App/src/pages/home/report/ReportActionCompose.js
Line 390 in 64ecc7a
Because of this difference, we call
updateCommenton composer mount.What changes do you think we should make in order to solve the problem?
updateCommentdo other things besides updatingisCommentEmptyso we shouldn't use it to updateisCommentEmptycorrectly. I see this as a workaround. Instead, we should correctly initializeisCommentEmptyby using the same condition.update
App/src/pages/home/report/ReportActionCompose.js
Line 283 in 64ecc7a
to
!!comment.match(/^(\s)*$/)(we can create a new function to contain this logic/condition)joekaufmanexpensify commentedon Aug 21, 2023
I can reproduce this, but not sure whether this really qualifies as a "bug". Going to bring up in Slack for discussion!
joekaufmanexpensify commentedon Aug 21, 2023
Posted here.
joekaufmanexpensify commentedon Aug 22, 2023
Discussed in the above thread and decided this isn't really a bug. Closing as no action is needed!