Skip to content
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

[$1000] Error in JS console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page #19228

Closed
1 of 6 tasks
kavimuru opened this issue May 18, 2023 · 32 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@kavimuru
Copy link

kavimuru commented May 18, 2023

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:

  1. Open the app.
  2. Navigate to the Magic Code page.
  3. Scroll down and click on either login or create a new account link.

Expected Result:

This should cause no error in the console.

Actual Result:

An error is displayed in the console when the login button or the account creation link is clicked.

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.16.3
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

2023-05-16.21-14-12.online-video-cutter.com.mp4
Recording.649.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Harshdeepjoshi
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684258502046179

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a33b3f9d19c242e2
  • Upwork Job ID: 1660556947910672384
  • Last Price Increase: 2023-05-22
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented May 18, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Error in console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page.

What is the root cause of that problem?

in Hoverable component There is no null check here for this.wrapperView which it may be null between re-render.
We use Hoverable in SignInPageLayout > surround the footer links.

onBlur={(el) => {
if (this.wrapperView.contains(el.relatedTarget)) {
return;
}
this.setIsHovered(false);
}}

onBlur: (el) => {
if (!this.wrapperView.contains(el.relatedTarget)) {
this.setIsHovered(false);
}
if (_.isFunction(this.props.children.props.onBlur)) {
this.props.children.props.onBlur(el);
}
},

What changes do you think we should make in order to solve the problem?

add null check for this.wrapperView in onBlur statment.

onBlur={(el) => {
    if (!_.isNull(this.wrapperView) && this.wrapperView.contains(el.relatedTarget)) {
        return;
    }
    this.setIsHovered(false);
}}

What alternative solutions did you explore? (Optional)

@jliexpensify
Copy link
Contributor

@jliexpensify
Copy link
Contributor

jliexpensify commented May 22, 2023

Getting a second opinion from the team here - https://expensify.slack.com/archives/C01SKUP7QR0/p1684725923013839

UPDATE: Moving to external based off this post - https://expensify.slack.com/archives/C01SKUP7QR0/p1684424938812639

@jliexpensify jliexpensify changed the title Error in console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page. Error in JS console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page May 22, 2023
@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label May 22, 2023
@melvin-bot melvin-bot bot changed the title Error in JS console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page [$1000] Error in JS console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01a33b3f9d19c242e2

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Triggered auto assignment to @dangrous (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Harshdeepjoshi
Copy link
Contributor

Proposal

(Originally posted on Slack with bug report)
The issue occurs due to the this.wrapperView being set to null by default.

this.wrapperView = null;

so when this check executes. https://github.com/Expensify/App/blob/7ad2be02a9e7c9dc19e8a6556d3c8efde5ba5721/src/components/Hoverable/index.js#LL101C17-L101C17
it gives error
Cannot read properties of null (reading 'contains') as the state might not be set yet and still be null

Solution

We can simply add a null check for this.wrapperView in onBlur statement. (here src/components/Hoverable/index.js) to ensure that this.wrapperView is not null while executing the condition

like this

if (this.wraperView != null && this.wrapperView.contains(el.relatedTarget)) {
return;
}

Result

2023-05-16.23-20-38.online-video-cutter.com.1.mp4

@VitaliiP-0205
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.

Error in console when pressing the "Login" button or the "Create a New Account" link in the footer of Magic Code page.

What is the root cause of that problem?

The issue occurs due to the this.wrapperView being set to null by default.

What changes do you think we should make in order to solve the problem?

This issue can solve by adding null check for this.wrapperView in onblur event.
line 101 in here: https://github.com/Expensify/App/blob/main/src/components/Hoverable/index.js
if (this.wraperView != null && this.wrapperView.contains(el.relatedTarget)) {
return;
}

What alternative solutions did you explore? (Optional)

@mollfpr
Copy link
Contributor

mollfpr commented May 22, 2023

@jliexpensify @dangrous I believe the compensation for console error is $500?

Proposal from @ahmedGaber93 looks good to me!

🎀 👀 🎀 C+ reviewed!

@dangrous
Copy link
Contributor

Works for me! Assigning now..

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

📣 @ahmedGaber93 You have been assigned to this job by @dangrous!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@Harshdeepjoshi
Copy link
Contributor

@dangrous @mollfpr I first proposed similar solution on slack before everyone and I am reporter of this bug as well. I also linked the slack proposal on this issue as per the rules. Shouldn't I be selected for this job (like here) if my proposal is correct?

@mollfpr
Copy link
Contributor

mollfpr commented May 23, 2023

Note: whilst you may optionally propose a solution for that job on Slack, solutions are ultimately reviewed in GitHub. The onus is on you to propose the solution on GitHub, and/or ensure the issue creator will include a link to your proposal.

@Harshdeepjoshi Sorry, even though you posted the solution first in Slack, the reviewer wouldn't know that, and not possible for us to always check the Slack thread. I even didn't notice that you post a proposal in Slack, because you're not using the proposal template, and maybe that's the reason the issue creator didn't include your proposal.

The idea of leaving a proposal in your bug report is, the issue creator will post it right after the Github issue is created. So, the first proposal is still what we have in the GitHub issue, and following the proposal template is essential to understand your solution.

cc @dangrous @jliexpensify

@jliexpensify
Copy link
Contributor

@mollfpr , in regards to this:

I believe the compensation for console error is $500?

Is there a link you can share where this was discussed? This is the first time I've come across a console error, cheers!

@mollfpr
Copy link
Contributor

mollfpr commented May 23, 2023

@jliexpensify I only have an example of it #17876 (comment)

But I'm not sure because this is not a DEV error 🤷‍♂️

@jliexpensify
Copy link
Contributor

Cheers, getting some clarity internally here - https://expensify.slack.com/archives/C01SKUP7QR0/p1684817728719929?thread_ts=1684725923.013839&cid=C01SKUP7QR0

@ahmedGaber93
Copy link
Contributor

@mollfpr PR is ready for review.

@jliexpensify
Copy link
Contributor

@mollfpr - all good, we can keep these JS issues at $1000 for consistency's sake.

@mollfpr
Copy link
Contributor

mollfpr commented May 25, 2023

@dangrous @jliexpensify This issue is solved at #16052 that refactored the Hoverable component because delete this line https://github.com/Expensify/App/blob/7ad2be02a9e7c9dc19e8a6556d3c8efde5ba5721/src/components/Hoverable/index.js#LL101C17-L101C17 where the issue from. What's the action in this situation?

@dangrous
Copy link
Contributor

Huh, good question. I will start a discussion!

@jliexpensify
Copy link
Contributor

Good discussion @dangrous - it looks like we will pay this one.

It looks like the other PR is still ongoing - so maybe let's pay once it's actually deployed to prod and properly tested? @mollfpr and @ahmedGaber93 , can you test this and share an update? Thanks!

@ahmedGaber93
Copy link
Contributor

@jliexpensify

Screen.Recording.2023-05-28.at.8.30.34.PM.mov

@jliexpensify
Copy link
Contributor

Thanks for checking!

@mollfpr and @ahmedGaber93 - after discussing it with the team, @dangrous and I will pay 50% (i.e. $500), since this was resolved with the other PR. Sound good?

@mollfpr
Copy link
Contributor

mollfpr commented May 31, 2023

@jliexpensify sounds good to me!

@jliexpensify
Copy link
Contributor

@ahmedGaber93 what's your Upworks profile? Cheers

@ahmedGaber93
Copy link
Contributor

@jliexpensify sounds good to me, too.

@ahmedGaber93
Copy link
Contributor

@jliexpensify https://www.upwork.com/freelancers/~012883934e2c4dc4e7

@jliexpensify
Copy link
Contributor

Cheers, invites sent - will pay once accepted.

@jliexpensify
Copy link
Contributor

Paid, and job closed - thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants