-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 2023-06-08] [$1000] Copying HTML character entities from the composer and then pasting them in the composer converts them to a literal character i.e. > becomes >. #19456
Comments
Triggered auto assignment to @jliexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Copying HTML character entities from the composer and then pasting them in the composer converts them to a literal character What is the root cause of that problem?when we handle the paste event in case of plain text we decoded to HTML so the entities get decoded App/src/components/Composer/index.js Line 360 in e1daecc
What changes do you think we should make in order to solve the problem?we could change this to pass the plain text and decode only in case of HTML What alternative solutions did you explore? (Optional)we can escape the entities first before passing to the decode that will return to the original but will be more calculations |
Can repro on Staging v1.3.17-1 |
Job added to Upwork: https://www.upwork.com/jobs/~01a1fad58c2e2ecbef |
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
Triggered auto assignment to @danieldoglas ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Copying HTML character entities from the composer and then pasting them in the composer converts them to a literal character i.e. > becomes >. What is the root cause of that problem?When we paste the data into composer we have used What changes do you think we should make in order to solve the problem?As we can see in the code below we are collecting the data as plain text so we don't need to decode it App/src/components/Composer/index.js Line 358 in e1daecc
existing code App/src/components/Composer/index.js Line 360 in e1daecc
Here is the updated line -
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Copy and paste HTML entities convert it to it's character representation, for example What is the root cause of that problem?When we paste a text into composer, we decode the text. There are 3 cases where we decode the text.
What changes do you think we should make in order to solve the problem?For 1st and 3rd case, as we are pasting a plain text, we can safely remove For the 2nd case, we should definitely keep the HTML decoding (for case like this). The proper solution to solve it is to encode the text we copy from Composer. We have a code to handle copying from Composer here: App/src/components/Composer/index.js Lines 377 to 388 in d70b746
So, we can simply encode (_.escape / Str.htmlEncode, idk which one is preferable) the |
@danieldoglas @jliexpensify I don't think I can get to this soon. I am unassigning myself. Can you please tag another C+ member? |
taking this |
📣 @s77rt You have been assigned to this job by @jliexpensify! |
@s77rt assigned you as C+ |
@YousefKhawaga Thanks for the proposal. Your RCA is correct but not complete as it does not explain why the issue is only reproducible when you copy from the Composer i.e. if you copy from a Slack message or GH the bug won't be reproducible. |
@kamaljitSharma21 Thanks for the proposal. I think it's the same as @YousefKhawaga's proposal so same note above ^ |
it's related to the pasting i tried from to get from GH same problem as the plainText is decoded no matter from where it has been copied. 27.05.2023_01.54.15_REC.mp4 |
@s77rt this will happen if taken from any composer or notepad as it's treated as plain text 2.mp4 |
@bernhardoj Thanks for the proposal. Your RCA is correct. The bug here is in two parts:
The suggested solutions (respectively) looks good to me:
Sorry for restating those ^ I felt some clarification is needed here. I have also noticed that putSelectionInClipboard relies on the And... |
@bernhardoj That's even better. I tested earlier and I was not able to reproduce #12769. If you are not able to reproduce it either (after removal putSelectionInClipboard) then yeah let's remove putSelectionInClipboard. |
Yep, unable to reproduce #12769 after removing putSelectionInClipboard. |
Awesome! 🚀 |
📣 @bernhardoj You have been assigned to this job by @danieldoglas! |
PR merged. |
Cool, looks like you qualify for the bonus! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.21-2 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-06-08. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
Regression Test Proposal (Web/Desktop)
|
Should I go ahead and send a proposal to this issue's Upwork job for the reporting bonus or wait for an invitation to be sent? |
@Victor-Nyagudi This is not due payment yet. You can just wait for now and it will become clear 😁 (I'm not sure if you will get invited or asked to apply) |
@s77rt Just thought I'd confirm so everything is ready for tomorrow. |
Hi @Victor-Nyagudi - I'm handling payments so I'll be sending out invites and paying sometime tomorrow. EDIT: Everyone has been hired. |
@danieldoglas - all good with the regression test here? |
Yes! |
Regression test linked, everyone is paid, job closed in Upworks. Cheers everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
>
or&
or£
Expected Result:
HTML character entity is pasted as is i.e.
>
is pasted as>.
Actual Result:
HTML character entity is converted i.e.
>
becomes > ,&
becomes & , etc.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?
Version Number: 1.3.17.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
Notes/Photos/Videos: Any additional supporting documentation
expensify-html-entities-bug.mov
Recording.732.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Victor-Nyagudi
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684521621028419
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: