-
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-08-28] [$1000] Chat - Email is pasted twice in the composer when copied from user profile #25409
Comments
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
|
Triggered auto assignment to @bondydaa ( |
This was first reported by me - https://expensify.slack.com/archives/C049HHMV9SM/p1692127516386599 |
This error was introduced in this PR #23359 ProposalPlease re-state the problem that we are trying to solve in this issue.Double paste in composer after copying email prom profile What is the root cause of that problem?First of all, the error only happens when the profile is opened (copy email) and then closed because it triggers the handler of navigation focus. Then there are 2 different paste handlers at the same time, one associated to the whole document and one associated to the input Hence handlePaste is called 2 times App/src/components/Composer/index.js Lines 355 to 366 in 2e1c4e7
PS: There is another error reading the code. If Update after @situchan comment we should handle it as the class component had it before where paste was handled as a document event with What changes do you think we should make in order to solve the problem?Both handlers should be handled the same way, either both are associated with the document to ensure the handler is removed when navigation blur is called or there is a validation to handle each case. So instead of using textInput.current for paste we can use document for handling the paste event always Also in the return method of the effect we should do: In pseudocode something like if we want to handle both: const unsubscribeFocus = navigation.addListener('focus', () => {
if (textInput.current) {
textInput.current.addEventListener('paste', handlePaste);
}
else {
document.addEventListener('paste', handlePaste)
}
});
const unsubscribeBlur = navigation.addListener('blur', () => {
if (textInput.current) {
textInput.current.removeEventListener('paste', handlePaste);
}
else {
document.removeEventListener('paste', handlePaste)
}
}); What alternative solutions did you explore? (Optional)Validate if handlePAste is already called in some way and avoid multicall or something like throttle in the same method but too complex for a simple task cc @mountiny |
ProposalPlease re-state the problem that we are trying to solve in this issue.Email is pasted twice in the composer when copied from user profile. What is the root cause of that problem?In App/src/components/Composer/index.js Line 358 in e89ea9d
App/src/components/Composer/index.js Line 366 in e89ea9d
So the text is pasted twice in the composer. What changes do you think we should make in order to solve the problem?We should remove one if (textInput.current) {
- textInput.current.addEventListener('paste', handlePaste); What alternative solutions did you explore? (Optional)None. |
@daordonez11 Are you bale to create a PR for this with a fix now? Its a deploy blocker so urgency is required. @bondydaa would you like to let the contributor fix this? |
Job added to Upwork: https://www.upwork.com/jobs/~01f8779e48a7b14b9d |
Triggered auto assignment to @twisterdotcom ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @jliexpensify ( |
Current assignee @situchan is eligible for the External assigner, not assigning anyone new. |
@bondydaa up to you |
ProposalPlease re-state the problem that we are trying to solve in this issue.Text is pasted twice when text is copied from user profile. What is the root cause of that problem?When navigation is focused it will add a 'paste' event listener, which makes the component have two event listeners at once triggering paste twice. What changes do you think we should make in order to solve the problem?Prior to adding the event listener to 'textInput', initiate a call to What alternative solutions did you explore? (Optional) |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.55-8 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-08-28. 🎊 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:
|
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:
|
Do I get any reporting bonus #25409 (comment) for this one? |
Payment summary: Reporting: Applause N/A |
@bondydaa, @twisterdotcom, @daordonez11, @MitchExpensify, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Regression Test Proposal:
@MitchExpensify I am also eligible for reporting bonus as I reported before this GH is created - #25409 (comment) |
Paid reporting bonus! |
Added new test request - Thanks everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Email is pasted once in the composer
Actual Result:
Email is pasted twice in the composer
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.55-1
Reproducible in staging?: Yes
Reproducible in production?: No
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
Bug6168183_bandicam_2023-08-17_22-20-02-511.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: