Skip to content

[$250] Android - 2-FA – Use two-factor authentication code and Use recovery codes blinks #48712

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.30-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+gm103086@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

User have 2-FA established

  1. Open New Dot app
  2. On login page enter your email address and magic code
  3. Verify 2-FA page is opened
  4. Switch between "Use two-factor authentication code" and "Use recovery codes"

Expected Result:

"Use two-factor authentication code" and "Use recovery codes" options should not blink

Actual Result:

Options "Use two-factor authentication code" and "Use recovery codes" blinks

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6595150_1725614013433.Recording__3889.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834200655136685716
  • Upwork Job ID: 1834200655136685716
  • Last Price Increase: 2024-09-19
  • Automatic offers:
    • brunovjk | Reviewer | 104097398
Issue OwnerCurrent Issue Owner: @brunovjk

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 6, 2024
  2. melvin-bot commented on Sep 6, 2024

    @melvin-bot

    Triggered auto assignment to @kevinksullivan (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. lanitochka17 commented on Sep 6, 2024

    @lanitochka17
    Author

    @kevinksullivan FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. bernhardoj commented on Sep 8, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The use recovery code/use 2fa code blinks when pressing it.

    What is the root cause of that problem?

    The text button for use recovery code/2fa code use the same Pressable. We just conditionally render the text depends on whether we want to use recovery/2fa code.

    <PressableWithFeedback
    style={[styles.mt2]}
    onPress={switchBetween2faAndRecoveryCode}
    hoverDimmingValue={1}
    pressDimmingValue={0.2}
    disabled={isValidateCodeFormSubmitting}
    role={CONST.ROLE.BUTTON}
    accessibilityLabel={isUsingRecoveryCode ? translate('recoveryCodeForm.use2fa') : translate('recoveryCodeForm.useRecoveryCode')}
    >
    <Text style={[styles.link]}>{isUsingRecoveryCode ? translate('recoveryCodeForm.use2fa') : translate('recoveryCodeForm.useRecoveryCode')}</Text>
    </PressableWithFeedback>

    So, when we press the text button, the press dim is applied, which reduces the opacity to 0.2 and because it uses the same Pressable, the dim affects the 2nd text too. For example, if the text is initially Use recovery code, when we press it, the text is switched to Use 2FA code and the dim is applied briefly to Use 2FA code too, so it looks like the text is blinking. The 0.2 opacity makes the "blink" obvious.

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

    We can remove the 0.2 dim value and just let it use the default value (0.8), just like the Go back text button but I don't think it solves the root cause.
    image

    So, to solve the root cause, we can set a key to the pressable so a new instance of pressable is created every time we switch between codes.

    We can use the boolean value (and convert it to string) as the key or use the text itself or any other value.

    key={isUsingRecoveryCode}
    key={isUsingRecoveryCode ? translate('recoveryCodeForm.use2fa') : translate('recoveryCodeForm.useRecoveryCode')}
    
  5. github-actions commented on Sep 8, 2024

    @github-actions
    Contributor

    @bernhardoj Your proposal will be dismissed because you did not follow the proposal template.

  6. melvin-bot commented on Sep 9, 2024

    @melvin-bot

    @kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  7. melvin-bot commented on Sep 11, 2024

    @melvin-bot

    @kevinksullivan Eep! 4 days overdue now. Issues have feelings too...

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 12, 2024
  9. changed the title [-]Android - 2-FA – Use two-factor authentication code and Use recovery codes blinks[/-] [+][$250] Android - 2-FA – Use two-factor authentication code and Use recovery codes blinks[/+] on Sep 12, 2024
  10. melvin-bot commented on Sep 12, 2024

    @melvin-bot
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 12, 2024
  12. melvin-bot commented on Sep 12, 2024

    @melvin-bot

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

  13. 25 remaining items

  14. NikkiWines commented on Sep 24, 2024

    @NikkiWines
    Contributor

    Yep! @bernhardoj proposal looks good 👍

  15. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 24, 2024
  16. melvin-bot commented on Sep 24, 2024

    @melvin-bot

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

    Offer link
    Upwork job

  17. bernhardoj commented on Sep 24, 2024

    @bernhardoj
    Contributor

    PR is ready

    cc: @brunovjk

  18. brunovjk commented on Oct 2, 2024

    @brunovjk
    Contributor

    The PR went into production on Sep 30.

    cc: @VictoriaExpensify

  19. brunovjk commented on Oct 7, 2024

    @brunovjk
    Contributor
    • [@brunovjk] The PR that introduced the bug has been identified. Link to the PR: I haven't found any PR that could have introduced this bug, as it's an edge case and it seems like it's always been there.
    • [@brunovjk] 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:
    • [@brunovjk] 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:
    • [@brunovjk] Determine if we should create a regression test for this bug. Yes
    • [@brunovjk] 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 Proposal:

    Prerequisite: 2FA is enabled; Plataform: Android native.

    • Log out
    • Enter your login and magic code
    • Press the Use two-factor authentication code/Use recovery codes multiple times to switch between those two text
    • Verify the text is not blinking.

    Do we agree 👍 or 👎?

    cc: @VictoriaExpensify

  20. VictoriaExpensify commented on Oct 9, 2024

    @VictoriaExpensify
    Contributor

    Payment summary:
    Contributor: @bernhardoj owed $250 via NewDot
    Contributor+: @brunovjk paid $250 via Upwork

    Thanks for your work on this!

  21. bernhardoj commented on Oct 10, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  22. JmillsExpensify commented on Oct 15, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions