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

[HOLD for payment 2023-08-16] [$1000] mweb - Conversation - Login field is focused when sign out in offline mode #23797

Closed
1 of 6 tasks
kbecciv opened this issue Jul 28, 2023 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 28, 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. Login to NewDot
  2. Disable the internet connection
  3. Tap on a few chats in LHN
  4. Tap Settings
  5. Tap Sign out
  6. Enable the internet connection

Expected Result:

When Login page appear the login field should not be focused (cursor should not be shown on the input field)

Actual Result:

The login field is focused (cursor is shown on the input field)

Workaround:

Unknown

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.44-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

Bug6143968_issue.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012346a785d1fce53c
  • Upwork Job ID: 1685011419766251520
  • Last Price Increase: 2023-07-28
  • Automatic offers:
    • hoangzinh | Contributor | 25890078
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 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

@samh-nl
Copy link
Contributor

samh-nl commented Jul 28, 2023

Proposal

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

Login field is focused when sign out in offline mode

What is the root cause of that problem?

In LoginForm, we automatically focus the input on mount regardless of network status.

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

We should check that this.props.network.isOffline is false before focusing the input through input.current.focus() in LoginForm.

What alternative solutions did you explore? (Optional)

We can disable the input when the user is offline.

@hoangzinh
Copy link
Contributor

hoangzinh commented Jul 28, 2023

Proposal

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

Conversation - Login field is focused when sign out on touchable devices

What is the root cause of that problem?

I think it's regression from this PR #22224. Previously, if we're using touchable devices, the login input is only focused when the login form is visible again https://github.com/Expensify/App/pull/22224/files#diff-e51fb1efdb0fbb2f3f94e412595749301118191aaf0522067a137917935009abL91-L99 (mean if we're back from validate code page). But now, with above PR, we haven't checked this condition, we always focus when useEffect is triggered, in this case it's trigger when inputRef is assigned => It's root cause of In touchable devices, App focus in login field after sign out

useEffect(() => {
if (props.blurOnSubmit) {
input.current.blur();
}
if (!input.current || !props.isVisible) {
return;
}
input.current.focus();
}, [props.blurOnSubmit, props.isVisible, input]);

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

We can use our custom hook usePrevious to store previous value of props.isVisible then compare like previous change. Only focus if the form is re-visible again in this useEffect (!previousIsVisible && props.isVisible)

useEffect(() => {
if (props.blurOnSubmit) {
input.current.blur();
}
if (!input.current || !props.isVisible) {
return;
}
input.current.focus();
}, [props.blurOnSubmit, props.isVisible, input]);

@CortneyOfstad
Copy link
Contributor

Was able to recreate — getting eyes on this

@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Jul 28, 2023
@melvin-bot melvin-bot bot changed the title mweb - Conversation - Login field is focused when sign out in offline mode [$1000] mweb - Conversation - Login field is focused when sign out in offline mode Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012346a785d1fce53c

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

melvin-bot bot commented Jul 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

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

@donlaiq
Copy link

donlaiq commented Jul 30, 2023

Proposal

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

Login field is focused every time the login screen is reached.

What is the root cause of that problem?

The ref={input} attribute of the TextInput element on App/src/pages/signin/LoginForm.js.

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

At first sight, if it doesn't affect another part of the application, just removing it will solve the problem.

simplescreenrecorder-2023-07-29_18.59.00.mp4

@melvin-bot
Copy link

melvin-bot bot commented Jul 30, 2023

📣 @donlaiq! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@donlaiq
Copy link

donlaiq commented Jul 30, 2023

Contributor details
Your Expensify account email: donlaiq@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~017244f379211cb72b

@melvin-bot
Copy link

melvin-bot bot commented Jul 30, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@CortneyOfstad
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@CortneyOfstad
Copy link
Contributor

@thesahindia any thoughts on the proposal above?

Also, I'm heading OoO until 8/14, so reassigning BZ to keep an eye on this while I'm out 👍

@CortneyOfstad CortneyOfstad removed their assignment Aug 1, 2023
@CortneyOfstad CortneyOfstad added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 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

@CortneyOfstad CortneyOfstad self-assigned this Aug 1, 2023
@thesahindia
Copy link
Member

@hoangzinh, proposal seems good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

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

melvin-bot bot commented Aug 1, 2023

📣 @thesahindia Please request via NewDot manual requests for the Reviewer role ($1000)

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@hoangzinh
Copy link
Contributor

@thesahindia @PauloGasparSv Thanks for accepting my proposal. The PR is ready #24026. Please help me review it. Thanks ❤️

@melvin-bot
Copy link

melvin-bot bot commented Aug 5, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @hoangzinh got assigned: 2023-08-01 22:35:36 Z
  • when the PR got merged: 2023-08-05 01:24:18 UTC
  • days elapsed: 3

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 9, 2023
@melvin-bot melvin-bot bot changed the title [$1000] mweb - Conversation - Login field is focused when sign out in offline mode [HOLD for payment 2023-08-16] [$1000] mweb - Conversation - Login field is focused when sign out in offline mode Aug 9, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.51-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-08-16. 🎊

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 -- Applause, so no payment needed
  • Contributor that fixed the issue -- paid $1,000 + 50% bonus as completed within 3 days = $1,500
  • Contributor+ that helped on the issue and/or PR -- will be paid within NewDot, so no payment needed

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] 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:
  • [@thesahindia] 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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@CortneyOfstad / @slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/309602

@CortneyOfstad
Copy link
Contributor

@slafortune I'm back from OoO, so taking this back over — thanks for holding down the fort while I was gone!

@thesahindia bump on the checklist above, when you have a chance!

@CortneyOfstad
Copy link
Contributor

@thesahindia bump on the checklist above ^^^

@slafortune slafortune removed their assignment Aug 16, 2023
@CortneyOfstad
Copy link
Contributor

Payment has been made to @hoangzinh and contract completed in UpWork!

Bump @thesahindia on the checklist above so we can close this out 👍

@thesahindia
Copy link
Member

Sorry for the delay. I was out.

[@thesahindia] The PR that introduced the bug has been identified. Link to the PR:

#22224

[@thesahindia] 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:

#22224 (comment)

[@thesahindia] 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:

I think we should skip the discussion. This page was refactored and this case was missed.

[@thesahindia] Determine if we should create a regression test for this bug.

yes

[@thesahindia] 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.

Regression test steps -

On Web/Desktop

  1. Login to any account
  2. Click Sign out
  3. Verify that the login input is focused
  4. Enter any email -> click Continue to go to next step
  5. Click on Go back
  6. Verify that the login input is focused

On mWeb/Native apps

  1. Login to any account
  2. Tap Sign out
  3. Verify that the login input is NOT focused
  4. Enter any email -> Tap Continue to go to next step
  5. Tap on Go back
  6. Verify that the login input is focused

@CortneyOfstad
Copy link
Contributor

Regression test has been linked above, so this can be closed! Thanks all1

@JmillsExpensify
Copy link

Reviewed the details for @thesahindia. $1,500 approved for payment (equivalent to C) based on BZ summary above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants