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-12-07] [$500] Android - LHN is displayed instead Expensify uses Plaid to connect your account #30617

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 30, 2023 · 75 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 30, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.2.93.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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to account settings >> Workspace
  2. Click on the workspace to view its settings
  3. Click on Cards or Reimbursements settings
  4. Select "Connect bank account" >> "Connect online with Plaid
  5. Put app on background
  6. Open app again

Expected Result:

Expensify uses Plaid to connect your account is displayed instead LHN after putting the app in the background

Actual Result:

LHN is displayed instead Expensify uses Plaid to connect your account after putting the app in the background

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

Android: Native
Bug6257361_1698700041953.Screen_Recording_20231030_161932_New_Expensify__1_.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f99be3ed1dcad788
  • Upwork Job ID: 1719140445807620096
  • Last Price Increase: 2023-11-13
  • Automatic offers:
    • s77rt | Reviewer | 27755311
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 30, 2023
@melvin-bot melvin-bot bot changed the title Android - LHN is displayed instead Expensify uses Plaid to connect your account [$500] Android - LHN is displayed instead Expensify uses Plaid to connect your account Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

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

melvin-bot bot commented Oct 30, 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@nimishdubey2
Copy link

s

Copy link

melvin-bot bot commented Nov 1, 2023

📣 @nimishdubey2! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@s77rt
Copy link
Contributor

s77rt commented Nov 1, 2023

@shahinyan11 Thanks for the proposal. Can you please elaborate on your RCA? How is the lifecycle different?

After reopening the App I'm seeing an error which seems pretty much related to this bug

 ERROR  Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:
- You don't have multiple NavigationContainers in the app each with 'linking' enabled
- Only a single instance of the root component is rendered
- You have set 'android:launchMode=singleTask' in the '<activity />' section of the 'AndroidManifest.xml' file to avoid launching multiple instances

@shahinyan11
Copy link

@s77rt Sorry but there was a problem in my proposal and it didn't work completely. I'm currently working on this to fix the problem and create new proposal.

@shahinyan11
Copy link

shahinyan11 commented Nov 1, 2023

Proposal

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

Android - LHN is displayed instead Expensify uses Plaid to connect your account

What is the root cause of that problem?

The package react-native-plaid-link-sdk adds several different activitys. Most of them have a singleTask launch mode. But there is an activity that has a singleInstence launch mode and that is the cause of the current problem. This causes our app's main activity to call onCreate after going back by clicking on the app icon, since the app has a singleTask lunch mode. And calling onCreate restarts the application from scratch.

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

Update the react-native-plaid-link-sdk version to 10.8.0 . In this version all activities added by plaid link have the singleTask launch mode . And we also have to remove useDeepLinkRedirector() because this function is not exist in 10.8.0 version

And after that, we need to open the Plaid link window again because it closes after going back. For this I made below changes .

  1. The onExit function to below
  onExit: ({metadata}) => {
      Log.info('[PlaidLink] Exit: ', false, {metadata});
      props.onExit(metadata.status);
  },
  1. The onExitPlaid prop to below
onExitPlaid={(status) => {
    BankAccounts.setBankAccountSubStep(null)

    if(!status){
        BankAccounts.openPlaidView();
    }
}}

What alternative solutions did you explore? (Optional)

Be honest I could not find any function which generates plaid Link Token . If there is such a function we can call It in onExit function and add props.token in deeps of useEffect .
Example:

    useEffect(() => {
        props.onEvent(CONST.BANK_ACCOUNT.PLAID.EVENTS_NAME.OPEN, {});
        openLink({
            tokenConfig: {
                token: props.token,
            },
            onSuccess: ({publicToken, metadata}) => {
                props.onSuccess({publicToken, metadata});
            },
            onExit: ({metadata}) => {
                Log.info('[PlaidLink] Exit: ', false, {metadata});
                if(metadata.status){
                    props.onExit();
                    return
                }

                regenerateTokenFunction()
            },
        });

        return () => {
            dismissLink();
        };

        // We generally do not need to include the token as a dependency here as it is only provided once via props and should not change
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [props.token]);

@s77rt
Copy link
Contributor

s77rt commented Nov 2, 2023

@shahinyan11 Thanks for the update. Regarding your RCA:

When the Plaid Link window opens, the Android application goes into background mode

Any specific reason why this happens on Android only? Is this coming from react-native-plaid-link-sdk?


Note: For future proposals please do not post new comments instead just edit the old one

@shahinyan11
Copy link

@s77rt Yes it is coming from react-native-plaid-link-sdk . It's possible that this behavior can be changed using Java or Kotlin at the package level, but I'm not sure because I don't have enough knowledge with those.

@s77rt
Copy link
Contributor

s77rt commented Nov 2, 2023

@shahinyan11 If the bug is coming from react-native-plaid-link-sdk we should probably fix the bug upsteam.

@shahinyan11
Copy link

@s77rt But on the package side it's not a bug, it's just behavior for android.
I also noticed that Plaid has different integration methods, and there is a way with Webview, but I haven't explored it deeply.

@shahinyan11
Copy link

shahinyan11 commented Nov 2, 2023

@shahinyan11 If the bug is coming from react-native-plaid-link-sdk we should probably fix the bug upsteam.

And if so what should I do ?

@s77rt
Copy link
Contributor

s77rt commented Nov 2, 2023

@shahinyan11 We would probably need to fix react-native-plaid-link-sdk

@shahinyan11
Copy link

@s77rt is not the handling on the react native side an option ?

@s77rt
Copy link
Contributor

s77rt commented Nov 2, 2023

It's an option as long as the fix is on react-native-plaid-link-sdk (assuming the bug is on react-native-plaid-link-sdk)

@shahinyan11
Copy link

@s77rt Ok . I will continue to explore the react-native-plaid-link-sdk package until I get a response from you, maybe there will be another option

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 6, 2023

Not overdue. Still looking for proposals

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@dylanexpensify
Copy link
Contributor

Sounds good, thanks @s77rt! ❤️

@shahinyan11
Copy link

shahinyan11 commented Nov 6, 2023

@s77rt @dylanexpensify I have looked for other ways, but it is not possible to change this behavior in Android. There is only one way which we can try. This is the way to use Webview but Plaid does not recommend using WebViews for new integrations for below reasons:

User Experience: The Plaid Link SDKs for Android, iOS, and React Native are designed to provide a seamless and native experience for users. They are optimized for mobile devices and provide a better user experience than a WebView.

Security: The SDKs are more secure than a WebView integration. They are regularly updated to include the latest security enhancements and to meet evolving industry standards.

Maintenance and Support: Plaid actively maintains and supports the SDKs, ensuring they are up-to-date with the latest features and improvements. On the other hand, support for WebView-based integrations is being phased out.

Future Compatibility: Starting from September 30, 2023, all WebView-based integrations will need to extend the WebView handler for redirects to support certain institutions. This adds an additional layer of complexity to your integration.

For these reasons, Plaid recommends using the native SDKs for new integrations instead of a WebView.

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

melvin-bot bot commented Nov 20, 2023

📣 @s77rt 🎉 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

Copy link

melvin-bot bot commented Nov 20, 2023

📣 @shahinyan11 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@shahinyan11
Copy link

I expect my review request to be ready for review by the end of today.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 21, 2023
@dylanexpensify
Copy link
Contributor

Nice! @s77rt to review!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Android - LHN is displayed instead Expensify uses Plaid to connect your account [HOLD for payment 2023-12-07] [$500] Android - LHN is displayed instead Expensify uses Plaid to connect your account Nov 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

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

Copy link

melvin-bot bot commented Nov 30, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.5-7 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-12-07. 🎊

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

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

Copy link

melvin-bot bot commented Nov 30, 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:

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

@s77rt
Copy link
Contributor

s77rt commented Nov 30, 2023

  • The PR that introduced the bug has been identified: n/a the bug was upstream
  • The offending PR has been commented on: n/a
  • A discussion in #expensify-bugs has been started: n/a
  • Determine if we should create a regression test for this bug: Yes, the bug may happen again if we upgrade plaid to an effected version. A regression test should help prevent that

Regression Test Proposal

  1. Open app
  2. Go to Settings > Workspaces > any workspace > Bank account
  3. Press Connect online with Plaid
  4. Put app on background
  5. Open app again (from launcher)
  6. Verify that the last screen is visible and not LHN

@dylanexpensify
Copy link
Contributor

Payment upcoming!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 7, 2023
@shahinyan11
Copy link

@dylanexpensify the marked day has passed, but I have not yet received payment ? Is there any problems ?

@shahinyan11
Copy link

@dylanexpensify

@dylanexpensify
Copy link
Contributor

Apologies! Processing now @shahinyan11!

@dylanexpensify
Copy link
Contributor

Payment summary:

Please apply!

@dylanexpensify
Copy link
Contributor

@shahinyan11 offer sent!

@shahinyan11
Copy link

@dylanexpensify applied

@dylanexpensify
Copy link
Contributor

paid!

@shahinyan11
Copy link

@dylanexpensify Are not you leaving reviews at all? )

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

No branches or pull requests

7 participants