Avoid parsing html in editing composer when reloading page#18195
Conversation
|
@chiragsalian @mollfpr One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const parser = new ExpensiMark(); | ||
| const draftMessage = parser.htmlToMarkdown(this.props.draftMessage).trim(); | ||
| let draftMessage; | ||
| if (this.props.draftMessage === this.props.action.message[0].html) { |
There was a problem hiding this comment.
@eh2077 Could you add a comment explaining why we doing this and what issue we trying to solve?
| // unmount when user deletes content of textarea, we set previous message instead of empty string. | ||
| if (newDraft.trim().length > 0) { | ||
| this.debouncedSaveDraft(newDraft); | ||
| this.debouncedSaveDraft(_.escape(newDraft)); |
There was a problem hiding this comment.
I would also like to let you know that comment here will be helpful.
Reviewer Checklist
Screenshots/VideosWeb18195.Web.movMobile Web - Chrome18195.mWeb.Chrome.mp4Mobile Web - Safari18195.mWeb.Safari.mp4Desktop18195.Desktop.moviOS18195.iOS.mp4Android18195.Android.mp4 |
|
So far, the tests have been well, and the changes look good. 👍 Just some improvement for the test case. I don't think the current test case covers enough of your changes, and your test case only works on the web/desktop, where we should also cover the native test.
You can just edit this; the point is to cover all the cases where the issue arises. |
|
@mollfpr Updated test cases! |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM 👍
All yours @chiragsalian
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 1.3.9-13 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
Details
Fixed Issues
$ #17843
PROPOSAL: #17843 (comment)
Tests
# Heading4a. For Web/mWeb/Desktop, refresh the page with CMD+R or press the refresh button.
4b. For iOS/Android, close the App, then open the App again and go to the chat we send the message.
<h1>Heading</h1>and wait for seconds for the draft to save<h1>Heading</h1><h1>Heading</h1>Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
mobile-chrome.mp4
Mobile Web - Safari
mobile-safari.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.mp4