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-10-12] [$500] DEV: Web - Draft icon show even there is not any thing in input field #27362
Then go to remaining draft message and erase all text from input field
Expected Result:
Draft icon not shows if not have any text in input field
Actual Result:
Draft icon is shows even input field is empty
Workaround:
Unknown
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: Dev 1.3.57-5. Reproducible in staging?: no Reproducible in production?: no 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.
Draft icon show even there is not any thing in input field
What is the root cause of that problem?
Report.setReportWithDraft(reportID, true) is called but the empty text is saved that leads to the bug "Draft icon show even there is not anything in the input field". But why is empty text saved? It will be shown bellow:
Currently, we are using the debounce function to save the draft comment:
Because all the reports share the same debounce function above - debouncedSaveReportComment, so when the user opens chat report A and types any message then quickly switches to report B and types any messages, the debouncedSaveReportComment will ignore all the calls made within that 1000ms (contains the call that made in report A). It leads to the empty draft message being saved with report A.
What changes do you think we should make in order to solve the problem?
We can create the new debouncedSaveReportComment that is used separately for each chat report and replace the debounce function mentioned in the root cause part by it:
changed the title [-]DEV: Web - Draft icon show even there is not any thing in input field[/-][+][$500] DEV: Web - Draft icon show even there is not any thing in input field[/+]on Sep 13, 2023
The problem occurs when a user types in a message in one report chat, switches to another report and enters another message within one second. The new debounced function call happens, and the previous call becomes overridden, but a report menu item in LHN displays that it was edited.
What changes do you think we should make in order to solve the problem?
Move the debounced comment save function on the component level. So, every report will have it's own instance of that function. We need to do it in ReportActionCompose (parent component) because it has some use cases with canceling the debounce:
// ReportActionCompose.jsconstdebouncedSaveReportComment=useMemo(function(){return_.debounce((reportID,comment)=>{Report.saveReportComment(reportID,comment||'');},5000);},[]);
...
<ComposerWithSuggestions...debouncedSaveReportComment={debouncedSaveReportComment}// new property/>
What alternative solutions did you explore? (Optional)
changed the title [-][$500] DEV: Web - Draft icon show even there is not any thing in input field[/-][+][HOLD for payment 2023-10-12] [$500] DEV: Web - Draft icon show even there is not any thing in input field[/+]on Oct 5, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.77-7 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 2023-10-12. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
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:
Determine if we should create a regression test for this bug.
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.
Activity
DylanDylann commentedon Sep 13, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js
Lines 206 to 210 in 1223e1e
debouncedSaveReportCommentfunction is defined as below:What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
Result
Screencast.from.06-09-2023.16.48.47.webm
[-]DEV: Web - Draft icon show even there is not any thing in input field[/-][+][$500] DEV: Web - Draft icon show even there is not any thing in input field[/+]melvin-bot commentedon Sep 13, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e6da2ca5e140fdb7
melvin-bot commentedon Sep 13, 2023
Triggered auto assignment to @kadiealexander (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 13, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)kadiealexander commentedon Sep 19, 2023
Not overdue, please get your proposals in 📢
needpower commentedon Sep 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
In LHN, a draft icon shows when there is no text in the input field.
What is the root cause of that problem?
The
ComposerWithSuggestionscomponent, which is responsible for input text handling, saves a draft of input text with one second debounce:App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js
Lines 206 to 207 in e2a1343
App/src/libs/ComposerUtils/debouncedSaveReportComment.js
Lines 9 to 11 in 8000576
The problem occurs when a user types in a message in one report chat, switches to another report and enters another message within one second. The new debounced function call happens, and the previous call becomes overridden, but a report menu item in LHN displays that it was edited.
What changes do you think we should make in order to solve the problem?
Move the debounced comment save function on the component level. So, every report will have it's own instance of that function. We need to do it in
ReportActionCompose(parent component) because it has some use cases with canceling the debounce:What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Sep 20, 2023
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
29 remaining items
melvin-bot commentedon Oct 3, 2023
🎯 ⚡️ Woah @abdulrahuman5196 / @DylanDylann, great job pushing this forwards! ⚡️
The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀
[-][$500] DEV: Web - Draft icon show even there is not any thing in input field[/-][+][HOLD for payment 2023-10-12] [$500] DEV: Web - Draft icon show even there is not any thing in input field[/+]melvin-bot commentedon Oct 5, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 5, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.77-7 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 2023-10-12. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
abdulrahuman5196 commentedon Oct 10, 2023
#25758
https://github.com/Expensify/App/pull/25758/files#r1352852646
No. Not beneficial for a minor bug
kadiealexander commentedon Oct 16, 2023
Payouts due:
Eligible for 50% #urgency bonus? Yes
Upwork job