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-09] [HOLD for payment 2023-09-04] [HOLD 25758][$2000] App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report #21527
Send any message with ** around it to make it bold eg: hello
Hover and click on reply in thread
Edit the first message of new thread of reply in thread and keep it in edit mode
Open main report and edit the message on which we had clicked reply in thread
Again hover and click on reply in thread and observe that message now has HTML tag around it
Expected Result:
App should not display HTML tags around bold messages
Actual Result:
App display's strong HTML tag around message in reply in thread if the message is kept in edit and we edit that message in main thread
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.32-5 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.
App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report
What is the root cause of that problem?
The root cause of this issue is that
When editing the first message of thread, we save draft message(action.message[0].html) for key determined by reportID of thread and reportActionID of parent report action, see
is false because action.message[0].html has been changed and the props.draftMessage is still same as the html of original report action. So, the draft is
which displayes html tag if the original props.action.message[0].html is not plain text. Note that props.draftMessage which is saved in Step 1 is read from here through reportID of thread and reportActionID of parent report action.
What changes do you think we should make in order to solve the problem?
To fix this issue, we should save and read draftMessage for the first message of a thread using reportID of parent report and reportActionID of parent report action. The first message of thread already uses the same report action of parent report. So, we only need to fix the reportID.
To achieve it, we can
Change the second parameter of method saveReportActionDraft from reportActionID to reportAction and use to method ReportUtils.getOriginalReportID to get the right reportID. The changed method saveReportActionDraft will be like
/** * Saves the draft for a comment report action. This will put the comment into "edit mode" * * @param {String} reportID * @param {Number} reportAction * @param {String} draftMessage */functionsaveReportActionDraft(reportID,reportAction,draftMessage){constoriginalReportID=ReportUtils.getOriginalReportID(reportID,reportAction);Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${originalReportID}_${reportAction.reportActionID}`,draftMessage);}
Change all usages of Report.saveReportActionDraft to pass reportAction instead of reportActionID
Read draft message from correct reportID by changing this line
Add an effect to handle case of going back by browser back button and deleting action by saving empty draft. We can add following effect below this line
useEffect(()=>{// We want to early return if the action is deleted or it's an initial draftif(ReportActionsUtils.isDeletedAction(props.action)||props.draftMessage===props.action.message[0].html){return;}setDraft(Str.htmlDecode(props.draftMessage));},[props.draftMessage,props.action.message]);
After fixing, the editing state of the first message of a thread and the message from parent report will be synced.
Click to see demo videoScreen.Recording.2023-07-01.at.12.25.15.AM.mov
What alternative solutions did you explore? (Optional)
changed the title [-][HOLD for payment 2023-09-04] [HOLD 25758][$2000] App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report[/-][+][HOLD for payment 2023-10-09] [HOLD for payment 2023-09-04] [HOLD 25758][$2000] App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report[/+]on Oct 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-09. 🎊
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:
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:
[@situchan] The PR that introduced the bug has been identified. Link to the PR:
[@situchan] 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:
[@situchan] 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:
[@situchan] Determine if we should create a regression test for this bug.
[@situchan] 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.
[@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon Jun 25, 2023
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 25, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)dylanexpensify commentedon Jun 28, 2023
reviewing today!
dylanexpensify commentedon Jun 28, 2023
Cannot reproduce, @kavimuru can you confirm this is still happening?
dylanexpensify commentedon Jun 30, 2023
Closing, @kavimuru feel free to open if you can repro
eh2077 commentedon Jun 30, 2023
@kavimuru @dylanexpensify I can still reproduce it on prod, staging and dev. See below video FYI
21527-dupe-steps-video.mov
Reproduce steps:
eh2077 commentedon Jun 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report
What is the root cause of that problem?
The root cause of this issue is that
When editing the first message of thread, we save draft message(
action.message[0].html) for key determined byreportIDof thread andreportActionIDof parent report action, seeApp/src/pages/home/report/ContextMenu/ContextMenuActions.js
Line 258 in 2f6002f
After editing and saving the changed message from main report action and going back to thread, the following condition
App/src/pages/home/report/ReportActionItemMessageEdit.js
Line 84 in 2f6002f
is false because
action.message[0].htmlhas been changed and theprops.draftMessageis still same as the html of original report action. So, the draft isApp/src/pages/home/report/ReportActionItemMessageEdit.js
Line 90 in 2f6002f
which displayes html tag if the original
props.action.message[0].htmlis not plain text. Note thatprops.draftMessagewhich is saved in Step 1 is read from here throughreportIDof thread andreportActionIDof parent report action.What changes do you think we should make in order to solve the problem?
To fix this issue, we should save and read
draftMessagefor the first message of a thread usingreportIDof parent report andreportActionIDof parent report action. The first message of thread already uses the same report action of parent report. So, we only need to fix thereportID.To achieve it, we can
Change the second parameter of method saveReportActionDraft from
reportActionIDtoreportActionand use to methodReportUtils.getOriginalReportIDto get the right reportID. The changed methodsaveReportActionDraftwill be likeChange all usages of
Report.saveReportActionDraftto passreportActioninstead ofreportActionIDRead draft message from correct
reportIDby changing this lineApp/src/pages/home/report/ReportActionItem.js
Line 523 in 4bd1848
to
Add an effect to handle case of going back by browser back button and deleting action by saving empty draft. We can add following effect below this line
After fixing, the editing state of the first message of a thread and the message from parent report will be synced.
Click to see demo video
Screen.Recording.2023-07-01.at.12.25.15.AM.mov
What alternative solutions did you explore? (Optional)
N/A
kavimuru commentedon Jul 3, 2023
@dylanexpensify Issue is still reproduced by Dhanashree and Eric
21527-dupe-steps-video.mov
Screen.Recording.2023-07-03.at.8.42.01.PM.mov
168 remaining items
eh2077 commentedon Sep 25, 2023
@situchan Please kindly help to review the PR #28154 when you get time, thanks!
melvin-bot commentedon Sep 27, 2023
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀
dylanexpensify commentedon Oct 2, 2023
Payment summary:
dylanexpensify commentedon Oct 2, 2023
Payments sent! @situchan can we get BZ checklist done
situchan commentedon Oct 2, 2023
We never synced editing status of parent message and thread first message from the beginning.
Regression Test Proposal
*hello**hello**hello**hello* hi, save it and click Reply in threadsituchan commentedon Oct 2, 2023
Should I propose regression test for #27605 since our PR fixed that bug as well?
[-][HOLD for payment 2023-09-04] [HOLD 25758][$2000] App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report[/-][+][HOLD for payment 2023-10-09] [HOLD for payment 2023-09-04] [HOLD 25758][$2000] App displays strong HTML tag in reply in thread first message if we keep it in edit mode and edit message in main report[/+]melvin-bot commentedon Oct 2, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-09. 🎊
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:
melvin-bot commentedon Oct 2, 2023
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:
dylanexpensify commentedon Oct 10, 2023
yes please @situchan, just in that issue!