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-27] [$500] App triggers text to link even while save changes on edit message even when no changes is done #29225
changed the title [-]App triggers text to link even while save changes on edit message even when no changes is done[/-][+][$500] App triggers text to link even while save changes on edit message even when no changes is done[/+]on Oct 10, 2023
What changes do you think we should make in order to solve the problem?
Compare parsed original message to the new comment text as well (additional condition into the following if statement):
// Skip the Edit if message is not changed
if (parsedOriginalCommentHTML === htmlForNewComment.trim() || originalCommentHTML === htmlForNewComment.trim() || parsedOriginalCommentHTML === textForNewComment) {
return;
}
This is expected behavior as per #13551. It should have to be detected while comparing regression steps #13551.
cc: @m-natarajan Do we not check issues against existing regression steps before exporting? If, not. This is something that we should propose into the process.
@parasharrajat this issue means when you open edit input and save without any changes. Can you confirm that this is expected?
See demo video (current behavior):
Please re-state the problem that we are trying to solve in this issue.
App triggers text to link even while save changes on edit message even when no changes is done.
What is the root cause of that problem?
The root cause of this issue is that we call method Report.editReportComment to save draft without checking if the draft is changed from the very initial draft, parser.htmlToMarkdown(lodashGet(props.action, 'message[0].html')).trim(), or not, see here.
What changes do you think we should make in order to solve the problem?
To fix this issue, we only save draft when it's different from the initial draft, parser.htmlToMarkdown(lodashGet(props.action, 'message[0].html')).trim(). We can change this line to
in method Report.editReportComment to skip saving the draft, like here. I prefer the main solution as it avoids unnecessary text processing and is closer to the draft update function.
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:
[@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
[@parasharrajat] 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:
[@parasharrajat] 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:
[@parasharrajat] Determine if we should create a regression test for this bug.
[@parasharrajat] 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.
[@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
I think bonus is applicable because @parasharrajat had reviewed and approved PR within 3 days and the internal engineer late merged the PR without additional review comments in the PR #29418 (review).
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:
[@parasharrajat] 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: NA. This can be found during testing.
[@parasharrajat] Determine if we should create a regression test for this bug. Yes
[@parasharrajat] 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.
Regression Test Steps
Go to a chat and add a comment google.com.
Verify google.com is displayed as a link
Edit the message from [google.com](https://google.com/) to google.com and save it
Verify google.com is displayed as plain text
Click to edit the message and save it without making changes
Verify the message is not changed and google.com is still displayed as plain text
Edit the message from google.com to google.com http://new.expensify.com/ and save it
Verify both google.com and http://new.expensify.com/ are displayed as links
Edit the message from [google.com](https://google.com/) [http://new.expensify.com/](http://new.expensify.com/) to [google.com](https://google.com/) http://new.expensify.com/ and save it.
Verify that google.com is displayed as a link and http://new.expensify.com/ is displayed as plain text
Click to edit the message and save it without making changes
Verify that the message has not changed and they're displayed the same as in step 10.
Activity
[-]App triggers text to link even while save changes on edit message even when no changes is done[/-][+][$500] App triggers text to link even while save changes on edit message even when no changes is done[/+]melvin-bot commentedon Oct 10, 2023
Triggered auto assignment to @zanyrenney (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 10, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01c71d9095a2d85a78
melvin-bot commentedon Oct 10, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 10, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)offroader commentedon Oct 10, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When you explicitly remove a link from message and then try to edit message but save it without making any changes, app adds links again
What is the root cause of that problem?
We detect purposely removed links in this line
App/src/libs/actions/Report.js
Line 1180 in b5445bd
Then compare generated html vs original one, but the new html will always be different in our case
App/src/libs/actions/Report.js
Lines 1197 to 1200 in b5445bd
What changes do you think we should make in order to solve the problem?
Compare parsed original message to the new comment text as well (additional condition into the following if statement):
parasharrajat commentedon Oct 11, 2023
This is expected behavior as per #13551. It should have to be detected while comparing regression steps #13551.
cc: @m-natarajan Do we not check issues against existing regression steps before exporting? If, not. This is something that we should propose into the process.
offroader commentedon Oct 11, 2023
@parasharrajat this issue means when you open edit input and save without any changes. Can you confirm that this is expected?
See demo video (current behavior):
After my suggested changes:
So if you edit comment it will autolink again.
eh2077 commentedon Oct 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App triggers text to link even while save changes on edit message even when no changes is done.
What is the root cause of that problem?
The root cause of this issue is that we call method
Report.editReportCommentto save draft without checking if the draft is changed from the very initial draft,parser.htmlToMarkdown(lodashGet(props.action, 'message[0].html')).trim(), or not, see here.What changes do you think we should make in order to solve the problem?
To fix this issue, we only save draft when it's different from the initial draft,
parser.htmlToMarkdown(lodashGet(props.action, 'message[0].html')).trim(). We can change this line toSee demo
Screen.Recording.2023-10-11.at.7.00.09.PM.mov
What alternative solutions did you explore? (Optional)
We can also add condition
in method
Report.editReportCommentto skip saving the draft, like here. I prefer the main solution as it avoids unnecessary text processing and is closer to the draft update function.28 remaining items
melvin-bot commentedon Oct 20, 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:
zanyrenney commentedon Oct 27, 2023
@parasharrajat does not require payment (Eligible for Manual Requests) owed $500
@eh2077 requires payment offer (Contributor) - paid $500
@dhanashree-sawant requires payment offer (Reporter) paid $50
#29225 (comment) merged in 4 days, no bonus
Paid out, closing!
eh2077 commentedon Oct 27, 2023
@zanyrenney Thanks for checking the payment!
I think bonus is applicable because @parasharrajat had reviewed and approved PR within 3 days and the internal engineer late merged the PR without additional review comments in the PR #29418 (review).
parasharrajat commentedon Oct 29, 2023
Agree With @eh2077
parasharrajat commentedon Oct 29, 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:
Regression Test Steps
google.com.google.comis displayed as a link[google.com](https://google.com/)to google.com and save itgoogle.comis displayed as plain textgoogle.comis still displayed as plain textgoogle.comtogoogle.com http://new.expensify.com/and save itgoogle.comandhttp://new.expensify.com/are displayed as links[google.com](https://google.com/) [http://new.expensify.com/](http://new.expensify.com/)to[google.com](https://google.com/) http://new.expensify.com/and save it.google.comis displayed as a link andhttp://new.expensify.com/is displayed as plain textDo you agree 👍 or 👎 ?
parasharrajat commentedon Dec 5, 2023
@zanyrenney Could you please review this #29225 (comment)?
parasharrajat commentedon Apr 5, 2024
Payment requested as per #29225 (comment)
JmillsExpensify commentedon Apr 8, 2024
$500 approved for @parasharrajat
JmillsExpensify commentedon Apr 8, 2024
Also, I don't believe we have an regression test for this issue so re-opening.
zanyrenney commentedon Apr 11, 2024
Regression test created.