-
Notifications
You must be signed in to change notification settings - Fork 3k
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-11-09] [$500] Chat - The HTML code of the avatar is copied when copying the login name #29921
Comments
Triggered auto assignment to @bfitzexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~01cbaee99371cf5444 |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
ProposalThis GitHub issue consists of 2 issues. I have divided my proposal into 2 sections: PART 1 and PART 2 for that purpose PART 1: focuses on the first issuePlease re-state the problem that we are trying to solve in this issue.When selecting the text along with the avatar svg, the styling code present within the avatar svg is also getting copied Root causeHere's a Video with voiceover explaining the Root cause. It's also explaining how my proposed solution works
solution.mp4Video Summary: See my proposed solution below:- My solution that fixes this issue:-Lines 96 to 109 in 5d9649c
Add a sibling component with the 97 <Icon
... src={imageError ? fallbackAvatar : props.source}
... .....
... .....
... .....
108 />
+ 109 <View style={StyleSheet.absoluteFill} /> PART 2: focuses on the second issueThe second issue is reproducible in staging only. This is not reproducible in development Its not reproducible in dev, but I still have a good idea of what's causing it
watch the video to cross check the facts that I mentioned above demo.mp4 |
The first issue is the same issue as #24399 which was closed. |
Along with this current issue, the following 3 issues could be fixed by using @bernhardoj 's solution:-
We just need to add these 3 lines in SelectionScraper/index.js const replaceNodes = (dom, isChildOfEditorElement) => {
let domName = dom.name;
let domChildren;
const domAttribs = {};
let data;
+ if (dom.type === 'style') {
+ return {};
+ } I am just a newbie contributor here, but I personally think that the solution I provided by using a sibling |
You can use the 2023-10-20.13.43.58.mov |
📣 @shamerKill! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Interesting. why are we enforcing HTML selection for these elements? |
Isn't it the simplest way to create tags only for browsers by judging the platform. |
We just need to wrap it up. import React from 'react';
import {Platform} from 'react-native';
function Shadow (props) {
const isWeb = Platform.OS === 'web';
if (isWeb) {
return <shadow>{props.children}</shadow>
} else {
return props.children;
}
}
export default Shadow; |
@parasharrajat, @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
So I can see now why the issue is coming. To me, this is a valid issue because we are manipulating the selection thus we should fix it. I checked old issues as well and it seems that there was no clear conclusion on why they were ignored. The only reason was that reproduction is an edge case which does not convince me. Now we have multiple reproductions. Also, @bernhardoj's proposal makes the most sense. It proposes a simple solution and IMO makes the best fit for the problem. Still I have a few questions before I move so let's get those cleared first. |
IMO, this issue comes down to this line App/src/hooks/useCopySelectionHelper.ts Line 18 in 60576fe
We shouldn't be worried about the tags being parsed in the getHTMLSelection, the browser has native handling for all tags so it will itself filter style tags when pasted into a normal text input like many other HTML tags. It will only paste the text. Now, I see that we are manipulating the selection in the above-linked code and setting the text/html and text/plain parts in the clipboard. Our parser should have filtered the style tags while converting the HTML to text. But it seems it is failing to do so in this case. Issue 2 explanation #29921 (comment) I think the following changes should be made to fix this issue completely.
@bernhardoj's solution 3 works no doubt but I will still like to see analysis on point 2 above. @bernhardoj Are you interested in looking into this? Edit: I just found out that |
@parasharrajat I'm only interested in the first issue because I can't reproduce the 2nd one.
This isn't true.
It's not |
I think you misunderstood my comment. I am saying that when pasted browser will skip non-visual elements from being pasted into the input. It will filter style tags as well.
The code might be saying so but it is focused on our parser, not a generalized HTML-to-text solution. So the question is Should our parser convert style tags to text as well? It shouldn't, IMO. However, I am stunned to see that we are not filtering style tags in htmlToText rules. There might be some history to it. I will try to look into this. |
Ah, I see. I think it might be debatable whether we should filter out the style tag on |
The PR for ExpensiMark is here Expensify/expensify-common#593 cc: @parasharrajat |
Oh, it's merged already. Preparing the App PR... |
Great. |
PR is ready cc: @parasharrajat |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-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-11-09. 🎊 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.
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:
|
Payment summary: Contributor: @bernhardoj to be paid $500 via Upwork |
@johnmlee101, @parasharrajat, @bfitzexpensify, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@johnmlee101, @parasharrajat, @bfitzexpensify, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick! |
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 StepsWeb/Desktop/mWeb
Do you agree 👍 or 👎 ? |
Payment requested as per #29921 (comment) |
$500 approved for @parasharrajat |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.86-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: Applause - Internal Team
Slack conversation:
Action Performed:
Steps 2:
Expected Result:
When copying an account login through the conversation header, the avatar HTML code should not be copied to the buffer
Actual Result:
When copying the account login through the conversation header, the HTML code of the avatar is placed in the buffer
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Bug6242259_1697662281250.Recording__553.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: