Skip to content

[HOLD for payment 2024-10-25] Contact method - unlinkLoginForm.succesfullyUnlinkedLogin after unlinking secondary login #50256

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.44-7
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+kh021001@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account settings > Profile > Contact method
  3. Click New contact method
  4. Add a secondary email and enter magic code, but do not verify it
  5. Log in as the secondary email
  6. Click Unlink
  7. Open email with subject "Unlink secondary Expensify login"
  8. Click on the link "the validation link here"

Expected Result:

App will show the correct successful unlink message

Actual Result:

App shows unlinkLoginForm.succesfullyUnlinkedLogin after unlinking secondary login

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
Bug6624569_1728055712579.20241004_232118.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @trjExpensify / @trjExpensify

Activity

  1. added
    Daily
    Bug
    on Oct 4, 2024
  2. melvin-bot commented on Oct 4, 2024

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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 Oct 4, 2024

    @lanitochka17
    Author

    @trjExpensify 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. twilight2294 commented on Oct 4, 2024

    @twilight2294
    Contributor

    Proposal

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

    unlinkLoginForm.succesfullyUnlinkedLogin after unlinking secondary login

    What is the root cause of that problem?

    We are pasting unlinkLoginForm.succesfullyUnlinkedLogin in the success data here:

    const successData: OnyxUpdate[] = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.ACCOUNT,
    value: {
    isLoading: false,
    message: 'unlinkLoginForm.succesfullyUnlinkedLogin',
    },

    Then in the UnlinkLoginForm below, we check

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

    Pass a message prop to unlinkLogin and set it as message of successData, the message can be formed in UnlinkLoginPage here and then sent to the function.

    We would also ned to update the message below:

    const unlinkMessage = account?.message === 'unlinkLoginForm.linkSent' || account?.message === 'unlinkLoginForm.succesfullyUnlinkedLogin' ? translate(account?.message) : account?.message;
    as now we will set the actual message instead of the key

    If there is same bug with unlinkLoginForm.linkSent we need to fix that too, also need to check if any BE changes are needed

    Implementation:

    • In UnlinkLoginPage, we need to create a new const as UnlinkLoginMessage:
    const unlinkLoginMessage = translate('unlinkLoginForm.succesfullyUnlinkedLogin`)
    
        useEffect(() => {
            Session.unlinkLogin(Number(accountID), validateCode, unlinkLoginMessage);
    
        }, []);
    
    
    • then for unlinkLogin function, we would update it to:
    function unlinkLogin(accountID: number, validateCode: string, unlinkMessage: string) {
    ...
    ...
    ...
    const successData: OnyxUpdate[] = [
            {
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.ACCOUNT,
                value: {
                    isLoading: false,
                    message: unlinkMessage,
                },
            },
    

    What alternative solutions did you explore? (Optional)

  5. Nodebrute commented on Oct 4, 2024

    @Nodebrute
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-10-04 17:49:43 UTC.

    Proposal

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

    unlinkLoginForm.succesfullyUnlinkedLogin after unlinking secondary login

    What is the root cause of that problem?

    We are passing this as a string 'unlinkLoginForm.succesfullyUnlinkedLogin' and we are not using translate here

    message: 'unlinkLoginForm.succesfullyUnlinkedLogin',

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

    let's use translate here translate('unlinkLoginForm.succesfullyUnlinkedLogin')

    message: 'unlinkLoginForm.succesfullyUnlinkedLogin',

    Let's fix these two value too translate('unlinkLoginForm.linkSent') and translate('unlinkLoginForm.succesfullyUnlinkedLogin')
    const unlinkMessage = account?.message === 'unlinkLoginForm.linkSent' || account?.message === 'unlinkLoginForm.succesfullyUnlinkedLogin' ? translate(account?.message) : account?.message;

    We should look for other places too where we are not using translate and fix the issue

    Some other places where we should fix this

    message: 'resendValidationForm.linkHasBeenResent',

    message: 'unlinkLoginForm.linkSent',

    Note

    We should use the translate method wherever we are using these variables. This will address the issue at its core. Additionally, we have a reviewer checklist item emphasizing the importance of using the translate method with variables.

    I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the [translation method](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60)
    

    What alternative solutions did you explore? (Optional)

    Or we can also use Localize.translateLocal in Session/index.ts file and translate in UnlinkLoginForm.tsx file

  6. Nodebrute commented on Oct 4, 2024

    @Nodebrute
    Contributor

    Proposal Updated
    Added another place where the fix is needed

  7. Nodebrute commented on Oct 4, 2024

    @Nodebrute
    Contributor

    Updated Proposal
    Added Alternate solution

  8. added
    External
    on Oct 4, 2024
  9. melvin-bot commented on Oct 4, 2024

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  10. added
    Help Wanted
    on Oct 4, 2024
  11. melvin-bot commented on Oct 4, 2024

    @melvin-bot

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

  12. 38 remaining items

  13. removed
    Reviewing
    on Oct 18, 2024
  14. melvin-bot commented on Oct 18, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-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 2024-10-25. 🎊

    For reference, here are some details about the assignees on this issue:

    • @rojiphil requires payment (Needs manual offer from BZ)
    • @bernhardoj requires payment through NewDot Manual Requests
  15. melvin-bot commented on Oct 18, 2024

    @melvin-bot

    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:

    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR:
    • [@rojiphil] 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:
    • [@rojiphil] 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:
    • [@rojiphil] Determine if we should create a regression test for this bug.
    • [@rojiphil] 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.
    • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. rojiphil commented on Oct 24, 2024

    @rojiphil
    Contributor
    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
    • [@rojiphil] 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: Added comment
    • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
    • [@rojiphil] Determine if we should create a regression test for this bug. : Yes. We can
    • [@rojiphil] 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.

    Steps:

    1. Go to Settings->Profile and add a secondary email.
    2. Login with secondary email and click on Unlink
    3. Open Unlink Validation link email and click on the link
    4. Verify that the unlink success message is displayed.
  17. rojiphil commented on Oct 24, 2024

    @rojiphil
    Contributor

    @trjExpensify BZ Checklist is done

  18. added
    Daily
    and removed
    Weekly
    on Oct 25, 2024
  19. melvin-bot commented on Oct 25, 2024

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@puneetlath)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  20. trjExpensify commented on Oct 25, 2024

    @trjExpensify
    Contributor

    Great, thanks! Payment summary as follows:

    @rojiphil sent you an offer. @bernhardoj, go ahead and request.

  21. rojiphil commented on Oct 25, 2024

    @rojiphil
    Contributor

    @rojiphil sent you an offer.

    Thanks @trjExpensify. Accepted offer.

  22. trjExpensify commented on Oct 25, 2024

    @trjExpensify
    Contributor

    Perfect, paid!

  23. bernhardoj commented on Oct 26, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  24. JmillsExpensify commented on Oct 28, 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

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions