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-06-02] [$1000] Switching between windows takes cell pointer to unpredictable position in the new magic code input field #18324

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

Comments

@kavimuru
Copy link

kavimuru commented May 3, 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. Navigate to sign in page
  2. Enter email & click on ‘Continue’ button
  3. Open email in new window
  4. Open magic code email
  5. Open the window where expensify app is opened
  6. Enter two or more magic code digits
  7. Open the window where email is opened
  8. Open the windows where expensify app is opened again
  9. Enter more magic code digits

Expected Result:

Cell pointer moves to unpredictable position

Actual Result:

Cell pointer should remain at the position where we left of entering magic code

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

Recording.465.mp4
2023-05-03.03.22.29.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683073996655359

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018aab7f6c72d1c7ad
  • Upwork Job ID: 1657419055620501504
  • Last Price Increase: 2023-05-13
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 3, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@alexpensify
Copy link
Contributor

I'm catching up from being OOO on Friday and Monday, I'll try to test this one soon.

@aimane-chnaif
Copy link
Contributor

I suggest to hold this for #18398 where MagicCodeInput component is being refactored to functional component.

@alexpensify
Copy link
Contributor

Thank you for flagging, I will review that GH.

@alexpensify alexpensify added Weekly KSv2 and removed Daily KSv2 labels May 8, 2023
@alexpensify alexpensify changed the title Switching between windows takes cell pointer to unpredictable position in the new magic code input field [Hold] Switching between windows takes cell pointer to unpredictable position in the new magic code input field May 8, 2023
@alexpensify
Copy link
Contributor

Thank you @aimane-chnaif for the update. I'm putting this one on hold.

@alexpensify
Copy link
Contributor

Still on hold

1 similar comment
@alexpensify
Copy link
Contributor

Still on hold

@Natnael-Guchima
Copy link

Natnael-Guchima commented May 11, 2023

@alexpensify this #18398 refractor seems to be completed and deployed to staging.
And the behavior still holds.

2023-05-11.17.31.28.mp4

cc: @aimane-chnaif

@alexpensify
Copy link
Contributor

Thank you for the update @Natnael-Guchima - I'll test soon.

@alexpensify alexpensify changed the title [Hold] Switching between windows takes cell pointer to unpredictable position in the new magic code input field Switching between windows takes cell pointer to unpredictable position in the new magic code input field May 13, 2023
@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label May 13, 2023
@melvin-bot melvin-bot bot changed the title Switching between windows takes cell pointer to unpredictable position in the new magic code input field [$1000] Switching between windows takes cell pointer to unpredictable position in the new magic code input field May 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

Job added to Upwork: https://www.upwork.com/jobs/~018aab7f6c72d1c7ad

@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

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

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

melvin-bot bot commented May 13, 2023

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

@alexpensify
Copy link
Contributor

I tested on staging and was able to replicate the experience. The key here is to change tabs. Have staging open on one and then click another tab and then come back to the Expensify tab. I've taken this one off hold and assigned the External label.

@akinwale
Copy link
Contributor

akinwale commented May 13, 2023

Proposal

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

The magic code input does not behave as expected when the user switches away from the tab and switches back.

What is the root cause of that problem?

When a user switches away from the validation page to another browser tab, the underlying TextInput component is blurred, which triggers the blur event. When the user switches back to the tab for the validation page, the validation page is focused which causes the focus event to fire.. The onFocus() event handler is defined like so:

const onFocus = (event) => {
event.preventDefault();
setInput('');
};

This resets the input value in the state to an empty string, and causes re-entry from the first digit in magic code input.

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

Remove the setInput(''); call from the onFocus event, as this resets the state value. The magic code input does not need to be reset after it has been focused.

Note: After testing on all platforms with setInput removed, the magic code input still works as expected, and I can't find a reason why the call is there to reset the input state, so it's safest to take this approach.

If the setInput method absolutely has to be called in the onFocus event handler for whatever reason, then we can use it as below (by taking into consideration the value of the user's previous input). This is not recommended, however, as it will result in having to perform some extra, complicated checks to get it working properly in certain cases (e.g. if the user deletes random numbers from the magic code input, -2--56).

setInput(!_.isEmpty(props.value) ? props.value.trim() : '');

What alternative solutions did you explore? (Optional)

None.

Screen.Recording.2023-05-13.at.18.13.30.mp4

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Switching between windows takes cell pointer to unpredictable position in the new magic code input field [HOLD for payment 2023-06-02] [$1000] Switching between windows takes cell pointer to unpredictable position in the new magic code input field May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.18-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-06-02. 🎊

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

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 May 26, 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:

  • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@alexpensify
Copy link
Contributor

@Santhosh-Sellavel - When you get a chance, can you please fill out the checklist: #18324 (comment)

Thanks!

@alexpensify
Copy link
Contributor

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima

To prepare for the payment date, please apply to the job in Upwork:

https://www.upwork.com/jobs/~018aab7f6c72d1c7ad

Thanks!

@akinwale
Copy link
Contributor

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima

To prepare for the payment date, please apply to the job in Upwork:

https://www.upwork.com/jobs/~018aab7f6c72d1c7ad

Thanks!

Already applied. Thanks.

@Natnael-Guchima
Copy link

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima

To prepare for the payment date, please apply to the job in Upwork:

https://www.upwork.com/jobs/~018aab7f6c72d1c7ad

Thanks!

Applied. Thanks!

@alexpensify
Copy link
Contributor

@Santhosh-Sellavel - bumping this one, can you please apply to the Upwork job? I want to prepare the payments for June 2. Thanks!

@alexpensify
Copy link
Contributor

Everyone else is party-ready in Upwork, so I see you @Natnael-Guchima and @akinwale.

@alexpensify
Copy link
Contributor

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - the payments have been prepared in Upwork. Please accept and I can complete the process.

@akinwale
Copy link
Contributor

akinwale commented Jun 2, 2023

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - the payments have been prepared in Upwork. Please accept and I can complete the process.

@alexpensify Accepted, thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jun 3, 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:

cc: @francoisl Thoughts?

@Santhosh-Sellavel
Copy link
Collaborator

Regression Test Steps

  1. Navigate to the sign-in page.
  2. Enter your email and click the ‘Continue’ button.
  3. Open a new browser tab and navigate to any web page.
  4. Switch to the browser tab with the magic code and enter the first 2 or 3 digits of the magic code.
  5. Switch to the other browser tab.
  6. Switch back to the browser tab with the magic code input and attempt to enter more digits.
  7. Verify that the new digits entered continue from the current point, instead of overwriting the first set of digits that were already entered.

👍 or 👎

@Natnael-Guchima
Copy link

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - the payments have been prepared in Upwork. Please accept and I can complete the process.

Accepted! Thanks, @alexpensify.

@alexpensify
Copy link
Contributor

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - everyone has been paid in Upwork. I'll wait to confirm again on Monday, then will close the GH.

@akinwale
Copy link
Contributor

akinwale commented Jun 3, 2023

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - everyone has been paid in Upwork. I'll wait to confirm again on Monday, then will close the GH.

Payment received. Thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Got it thanks @alexpensify!

@Natnael-Guchima
Copy link

@Santhosh-Sellavel, @akinwale, @Natnael-Guchima - everyone has been paid in Upwork. I'll wait to confirm again on Monday, then will close the GH.

Payment received. Thanks!

@alexpensify
Copy link
Contributor

Thank you for confirming! I'm closing this GH and the job in Upwork. Great work here!

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests