-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2024-04-05] [$500] When editing a message with <div>
, it becomes <div>
#38539
Comments
Triggered auto assignment to @twisterdotcom ( |
Huh, I guess this happens for other HTML too. I'm also guessing a C+ will have a good idea where we might have encountered this before. I can't see anything though. |
Actually asking in Slack first: https://expensify.slack.com/archives/C06BDSWLDPB/p1710802921152459 |
<div>
, it becomes <div>
<div>
, it becomes <div>
Job added to Upwork: https://www.upwork.com/jobs/~010257a39eea7eb507 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif ( |
Hello, the issue you're having is because the input is being encoded or escaped before being rendered in the UI. I used 'dangerouslySetInnerHTML' attribute fixing this issue or you can use a match&replace method to translate all the symbols needed like (this can be also done only if you use backquotes or you can use it for non-backquotes+backquotes too) 38539.mp4Contributor details |
📣 @elmedinhajdari! 📣
|
Problem Root Cause Changes to Solve
I see the code we need to modify is most likely here:
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.The draft message suddenly becomes What is the root cause of that problem?In here and here, we can see that the However, in here, we're not escaping/encoding the draft properly before saving, although we explained that we want to do it here. So the What changes do you think we should make in order to solve the problem?In here, escape/encoded the draft properly before saving.
(Or use There could be other places that have the same issue, we can apply the same fix there. What alternative solutions did you explore? (Optional)We can ensure that
|
Really appreciate the suggestion. It looks like you're suggesting to encode (escape) the draft message before saving it using Str.htmlEncode. My question is, if the current issue is that users see decoded HTML entities (like <div> instead of <div>) when editing, simply changing how the draft is saved won't necessarily resolve the issue. If the draft is saved in an encoded form and then decoded upon retrieval for editing, wouldn't users will still encounter the same problem? |
Proposal updated to add an alternative solution @tychoprice Thanks for your feedback. I don't think there's any issue with that approach. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The draft edit message remains as it is, it should not convert to decode string What is the root cause of that problem?App/src/pages/home/report/ReportActionItemMessageEdit.tsx Lines 126 to 131 in 34fa987
line 130 draftMessage change to htmlDecode String What changes do you think we should make in order to solve the problem?App/src/pages/home/report/ReportActionItemMessageEdit.tsx Lines 126 to 131 in 34fa987
line 130 it need to change What alternative solutions did you explore? (Optional) Draft.message.mp4CC: @twisterdotcom |
@twisterdotcom Hi, I reported this issue on Slack and I had the info about it. Can I take this one as C+? |
I already started investigating this issue. |
Ah @dukenv0307 yeah sorry, I didn't see this in Slack so I just left it with @aimane-chnaif sorry. Let's leave it for now, if @aimane-chnaif needs to hand it off for any reason, I'll make sure it goes to you. Lots of proposals to go at here anyway @aimane-chnaif! |
@twisterdotcom No problem, I'm a new C+ so I'm not sure about this case. I'll try to volunteer before the issue is external |
@dukenv0307 please be C+ here since I will be OOO soon |
@twisterdotcom Happy to take this one as C+ |
📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
EUGH this always happens. |
Let's go with @tienifr's alternative solution. Currently, we're saving the draft value of main composer as its original form so we should do the same with edit composer 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @NikkiWines, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Nice, yep the alternative solution looks good here 👍 |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
I am working on the PR |
Last update was Friday Melvin. |
<div>
, it becomes <div>
<div>
, it becomes <div>
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊 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:
|
BugZero Checklist:
Regression test:
Do we 👍 or 👎 |
Eugh, all of the offer links are just |
Ahh, we have sent offers in the issue though okay: https://www.upwork.com/ab/applicants/1769863831107096576/hired |
Payment Summary:
|
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.54-0
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
Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710750972703159
Action Performed:
<div>
Expected Result:
The draft edit message remains as is
Actual Result:
The draft message suddenly becomes
<div>
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.2862.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: