Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.34k stars 2.77k forks source link

[HOLD for payment 2024-03-29] [$500] Android - Workspace - Link OAUth integration error appears "android_package_name is missing" #38099

Closed lanitochka17 closed 5 months ago

lanitochka17 commented 6 months ago

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

Action Performed:

  1. Log in with an expensifail account
  2. Create a workspace
  3. Go to the workspace settings
  4. Start adding Chase bank with plaid
  5. Tap on the "Continue to log in" button

Expected Result:

There shouldn't be any error messages

Actual Result:

Link OAUth integration error appears "android_package_name is missing"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/9541252a-bca1-4ac4-bded-c8197c3f60c5

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ff17a561ab809c61
  • Upwork Job ID: 1767500442058608640
  • Last Price Increase: 2024-03-12
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
melvin-bot[bot] commented 6 months ago

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

lanitochka17 commented 6 months ago

@laurenreidexpensify 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

bernhardoj commented 6 months ago

Proposal

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

When trying to connect with a Chase account, the Chase page shows an error message.

What is the root cause of that problem?

As pointed out by the error message, the android_package_name is missing. When we open the plaid page, the app will request an open plaid bank login API that passes redirectURI to the API to get the plaid token. https://github.com/Expensify/App/blob/d1a7dcaf42711c7738822edda5b619cb20eac7be/src/libs/actions/Plaid.ts#L12-L20

Based on the Plaid docs, for Android, we should use android_package_name instead of redirect_uri.

getPlaidLinkTokenParameters already returns the android package name when it's an Android platform, but we never use it. https://github.com/Expensify/App/blob/d1a7dcaf42711c7738822edda5b619cb20eac7be/src/libs/getPlaidLinkTokenParameters/index.android.ts#L4-L6

This issue happens after this PR where we only use redirectURI from getPlaidLinkTokenParameters.

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

Include androidPackage to the API params.

const {redirectURI, androidPackage} = getPlaidLinkTokenParameters();
const params: OpenPlaidBankLoginParams = {
    redirectURI,
    androidPackage,
melvin-bot[bot] commented 6 months ago

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

melvin-bot[bot] commented 6 months ago

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

HappyLife1222 commented 6 months ago

The error message "android_package_name is missing" typically occurs in the context of integrating with third-party services or APIs that require an Android package name to be specified. Here are a few common scenarios where this error may occur:

Firebase Authentication: When integrating Firebase Authentication in an Android app, the android_package_name parameter is required to link the Firebase project with the Android app. If this parameter is missing or incorrect, you may encounter the "android_package_name is missing" error.

Google Play Services API: When using Google Play Services APIs, such as Google Maps or Google Sign-In, the android_package_name is often required for authentication and authorization. If this parameter is not provided or is incorrect, you may receive the error message.

Third-Party SDKs: Some third-party SDKs or APIs may require the Android package name to be specified in order to authenticate requests or ensure proper communication between the app and the service. If the android_package_name is missing in these cases, you may encounter errors.

To resolve this error, make sure to check the documentation of the specific service or API you are integrating with and ensure that the android_package_name parameter is correctly provided in your configuration. Double-check that the package name specified matches the package name of your Android app.

melvin-bot[bot] commented 6 months ago

📣 @pavlenkoviktor! 📣 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>
HappyLife1222 commented 6 months ago

Contributor details Expensify account email: pavlenkoviktor44@outlook.com Upwork Profile Link: https://www.upwork.com/freelancers/~010757be5da859689d

melvin-bot[bot] commented 6 months ago

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

aimane-chnaif commented 6 months ago

@bernhardoj's proposal looks good and tests well. 🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 6 months ago

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

iwiznia commented 6 months ago

Proposal looks good to me. @bernhardoj, @aimane-chnaif do you understand why this started to show up now? Or is it just that no one noticed it till now?

melvin-bot[bot] commented 6 months ago

❌ There was an error making the offer to @aimane-chnaif for the Reviewer role. The BZ member will need to manually hire the contributor.

melvin-bot[bot] commented 6 months ago

❌ There was an error making the offer to @bernhardoj for the Contributor role. The BZ member will need to manually hire the contributor.

bernhardoj commented 6 months ago

I guess it's just no one noticed it.

PR is ready

cc: @aimane-chnaif

laurenreidexpensify commented 6 months ago

Offers sent manually to @bernhardoj and @aimane-chnaif in upwork

melvin-bot[bot] commented 5 months ago

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

melvin-bot[bot] commented 5 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.55-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-03-29. :confetti_ball:

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

melvin-bot[bot] commented 5 months ago

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:

iwiznia commented 5 months ago

@laurenreidexpensify seems we need to pay this

laurenreidexpensify commented 5 months ago

was OOO for Easter and the automation failed to update this to a daily for me, reviewing now

laurenreidexpensify commented 5 months ago

Payment Summary:

laurenreidexpensify commented 5 months ago

@bernhardoj @aimane-chnaif do we need a regression test?

bernhardoj commented 5 months ago

If there is no regression step yet, I think we need one. Taken from the PR QA Steps:

  1. Open a workspace bank account page
  2. Select "Connect online with Plaid"
  3. Select Chase bank account
  4. Press Continue with Login. A new web window will open
  5. Verify there is no Link OAuth error message