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-09-29] [$1000] Android - Login - Linkified email from external app is pasted as linkified email in email field #21411
There is a workaround, though. One can heuristically detect when the text is pasted and change it to some other text (so the internal formatting markers are cleared), but immediately change it back.
We could introduce these helpers:
constzeroWidthSpace='\u8203';/** * A very simple heuristic for detecting whether the text was pasted * * @param {String} oldText * @param {String} newText * @return {Boolean} */functionisTextPasted(oldText,newText){returnMath.abs(newText.length-oldText.length)>1;}/** * A helper for setting a TextInput-managed state, which ensures that the * text keeps being plain, even when formatted text is pasted by the user. * * @param {Object} component * @param {Function} buildState * @param {String} oldText * @param {String} newText */functionsetPlainTextInputState(component,buildState,oldText,newText){if(isTextPasted(oldText,newText)){// Set a similar but different text, so TextInput clears formatting markerscomponent.setState(buildState(`${zeroWidthSpace}${newText}${zeroWidthSpace}`,),()=>{// Change back to the pasted text (in the plain text)component.setState(buildState(newText));});}else{// If it doesn't look like a paste, set the state directly to minimize flickeringcomponent.setState(buildState(newText));}}
/** * Handle text input and clear formError upon text change * * @param {String} newText */onTextInput(newText){setPlainTextInputState(this,(text)=>({login: text}),this.state.login,newText,);this.setState({formError: null,});// ...}
changed the title [-] Android - Login - Linkified email from external app is pasted as linkified email in email field[/-][+][$1000] Android - Login - Linkified email from external app is pasted as linkified email in email field[/+]on Jun 27, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊
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.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
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:
[@s77rt] The PR that introduced the bug has been identified. Link to the PR:
[@s77rt] 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:
[@s77rt] 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:
[@s77rt] Determine if we should create a regression test for this bug.
[@s77rt] 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.
[@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Eligible for 50% #urgency bonus? N based on #21411 (comment) but also it looks like the PR was created Sept 13th & merged Sept 19th - does that sound right?
Hi @s77rt the Upwork job is closed, sorry I didn't realise that meant you couldn't see it. You and @fabriziobertoglio1987 were automatically hired so I can pay you through the closed job still.
Will you confirm the payment details here are good and I'll pay this? #21411 (comment)
Activity
melvin-bot commentedon Jun 23, 2023
Triggered auto assignment to @Christinadobrzyn (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 23, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jakub-trzebiatowski commentedon Jun 23, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When pasting rich text to the e-mail field, the formatting is preserved, although we'd like the text to be plain text.
What is the root cause of that problem?
On Android,
TextInputfor some reason is rich text input by default. It can contain initial formatted text, for example:Also, formatted text can be pasted by the user.
What changes do you think we should make in order to solve the problem?
Surprisingly, there is no way to disable the rich text properties of the
TextInput.There is a workaround, though. One can heuristically detect when the text is pasted and change it to some other text (so the internal formatting markers are cleared), but immediately change it back.
We could introduce these helpers:
And then use them in
LoginForm'sonTextInputmethod:Christinadobrzyn commentedon Jun 23, 2023
I'm not able to replicate this - reaching out in Slack to get more specific directions on how the email is copied.
jakub-trzebiatowski commentedon Jun 24, 2023
@Christinadobrzyn
You can copy any link, for what it's worth. Let's say from here. When I copied from Chrome, I had to use text selection.
RichText-1-compressed.mp4
Christinadobrzyn commentedon Jun 27, 2023
I might not be able to get this to work on Browserstack but it seems like enough people can reproduce it so I'll send it to External.
[-] Android - Login - Linkified email from external app is pasted as linkified email in email field[/-][+][$1000] Android - Login - Linkified email from external app is pasted as linkified email in email field[/+]melvin-bot commentedon Jun 27, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01fec00bf5a9d050cf
117 remaining items
melvin-bot commentedon Sep 22, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 22, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊
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:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Sep 22, 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:
s77rt commentedon Sep 23, 2023
Christinadobrzyn commentedon Sep 29, 2023
Payouts due:
Issue Reporter: NA
Contributor: $1000 @fabriziobertoglio1987
Contributor+: $1000 @s77rt
Eligible for 50% #urgency bonus? N based on #21411 (comment) but also it looks like the PR was created Sept 13th & merged Sept 19th - does that sound right?
Upwork job is here.
s77rt commentedon Sep 29, 2023
@Christinadobrzyn Can you please double check the Upwork job. It seems unavailable.
melvin-bot commentedon Oct 3, 2023
@s77rt, @Gonals, @fabriziobertoglio1987, @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick!
Christinadobrzyn commentedon Oct 3, 2023
Hi @s77rt the Upwork job is closed, sorry I didn't realise that meant you couldn't see it. You and @fabriziobertoglio1987 were automatically hired so I can pay you through the closed job still.
Will you confirm the payment details here are good and I'll pay this? #21411 (comment)
s77rt commentedon Oct 3, 2023
@Christinadobrzyn The payout summary looks correct 👍
Christinadobrzyn commentedon Oct 3, 2023
Perfect! Thanks for confirming @s77rt!
I have paid both you and @fabriziobertoglio1987 based on the payment structure here
I'll close this out but please let me know if you need anything else!