Changed <br> to <br /> as line break to solve the issue "Saving without editing the multiline comments edit box shows [Comment Deleted] in LHN"#433
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@sobitneupane can you please test your change on all platforms and post screenshots from each? Thanks! |
@puneetlath I have attached screen captured for Web, mWeb and Android. I don't have IOS and MacOS. |
|
Hey @sobitneupane, a few things.
|
|
@sobitneupane Looks like we need to change the tests as well. |
I'll send those in a while |
Updated. |
Changed. |
There was a problem hiding this comment.
LGTM 🎉 Tests well on all platforms.
cc: @Luke9389 ? 😂
@sobitneupane could you please remove this step from Tests and QA? Thanks |
| name: 'newline', | ||
| regex: /\n/g, | ||
| replacement: '<br>', | ||
| replacement: '<br />', |
There was a problem hiding this comment.
Will this affect ordinary messages as well as edited ones? Have we tested what this does in the "normal" situation of ppl sending each other messages?
There was a problem hiding this comment.
I ask bc the tests in the OP only mention editing an already-sent message
There was a problem hiding this comment.
Good question. I've looked into this here - Expensify/App#7268 (comment)
Basically, even if we pass Line1<br>Line2 to the API, the server returns Line1<br />Line2, and that's what is stored in Onyx.
I couldn't find any side effects that'll occur after implementing this change. I can't speak of any unrelated internal repos that use Expensimark.replace() though
This comment was marked as outdated.
This comment was marked as outdated.
|
Forgive me! Yes please, let's create a PR to deploy expensify-common change to Expensify/App. |
|
Created a PR ^ |


@puneetlath @rushatgabhane will you please review this?
This change is made to solve the issue "Saving without editing the multiline comments edit box shows [Comment Deleted] in LHN"
Reason:
In editReportComment in Report.js, we are using ExpensiMark as the parser and ExpensiMark uses
<br>as the line break. But the originalReportAction.message[0].html has<br />as the line break. So, two messages when compared appear different and it is considered to be edited. So, though the message is not edited, the message is indicated as an edited message. Problem begins here.Fixed Issues
$ Expensify/App#7268
Tests
QA
Web
comment_deleted.mp4
mWeb
vidma_recorder_edited_28012022_232927.mp4
Android
vidma_recorder_edited_28012022_225407.mp4