Skip to content

[Awaiting checklist completion] [$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading #32298

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:**1.4.6-1
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. Launch app
  2. Tap profile icon
  3. Tap Workspaces
  4. Tap on a Workspace
  5. Tap Bank account
  6. Tap "connect online with plaid"

Expected Result:

When user taps "connect online with plaid", single spinner loading in the page must be shown

Actual Result:

When user taps "connect online with plaid", double spinner can be seen in the page loading for few seconds

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

Bug6296385_1701369526058.plaid.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0196db5598b3527ce7
  • Upwork Job ID: 1730310951315976192
  • Last Price Increase: 2023-11-30
  • Automatic offers:
    • akinwale | Reviewer | 27980936
    • ZhenjaHorbach | Contributor | 27980939
Issue OwnerCurrent Issue Owner: @akinwale

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 30, 2023
  2. changed the title [-]Android-BA-Tapping connect online with plaid shows 2 spin circles loading[/-] [+][$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading[/+] on Nov 30, 2023
  3. melvin-bot commented on Nov 30, 2023

    @melvin-bot
  4. melvin-bot commented on Nov 30, 2023

    @melvin-bot

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

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 30, 2023
  6. melvin-bot commented on Nov 30, 2023

    @melvin-bot

    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
  7. melvin-bot commented on Nov 30, 2023

    @melvin-bot

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

  8. ZhenjaHorbach commented on Nov 30, 2023

    @ZhenjaHorbach
    Contributor

    Proposal

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

    Android-BA-Tapping connect online with plaid shows 2 spin circles loading

    What is the root cause of that problem?

    The problem is related to the display of components
    Since they can be displayed simultaneously
    There are cases when the condition for the ActivityIndicator and the condition for PlaidLink(At the beginning PlaidLink loader appears) are fulfilled simultaneously

    {lodashGet(plaidData, 'isLoading') && (
    <View style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]}>
    <ActivityIndicator
    color={theme.spinner}
    size="large"
    />
    </View>
    )}
    {Boolean(plaidDataErrorMessage) && <Text style={[styles.formError, styles.mh5]}>{plaidDataErrorMessage}</Text>}
    {Boolean(token) && !bankName && (
    <PlaidLink
    token={token}
    onSuccess={({publicToken, metadata}) => {
    Log.info('[PlaidLink] Success!');
    BankAccounts.openPlaidBankAccountSelector(publicToken, metadata.institution.name, allowDebit, bankAccountID);
    }}
    onError={(error) => {
    Log.hmmm('[PlaidLink] Error: ', error.message);
    }}
    onEvent={(event, metadata) => {
    BankAccounts.setPlaidEvent(event);
    // Handle Plaid login errors (will potentially reset plaid token and item depending on the error)
    if (event === 'ERROR') {
    Log.hmmm('[PlaidLink] Error: ', metadata);
    if (bankAccountID && metadata && metadata.error_code) {
    BankAccounts.handlePlaidError(bankAccountID, metadata.error_code, metadata.error_message, metadata.request_id);
    }
    }
    // Limit the number of times a user can submit Plaid credentials
    if (event === 'SUBMIT_CREDENTIALS') {
    App.handleRestrictedEvent(event);
    }
    }}
    // User prematurely exited the Plaid flow
    // eslint-disable-next-line react/jsx-props-no-multi-spaces
    onExit={onExitPlaid}
    receivedRedirectURI={receivedRedirectURI}
    />
    )}

    And that's why we see 2 loaders

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

    As for me instead of using && for each condition, we can refactor this component to use if / else since we expect to see only one of three components (Adding opposite conditions so as not to display components look like smell code )
    So that when we have PlaidLink available, other conditions will not be met (Including display of the ActivityIndicator)

    My idea looks something like this

            if (Boolean(token) && !bankName) {
                return <PlaidLink />;
            }
            if (plaidDataErrorMessage) {
                return <Text/>;
            }
            if (lodashGet(plaidData, 'isLoading')) {
                return <ActivityIndicator />;
            }
    

    What alternative solutions did you explore? (Optional)

    We can always disable the loader by changing the values of ONYXKEYS.PLAID_DATA when PlaidLink is available. For this we can use onLoad prop for PlaidLink (But for this we need to add a new prop onLoad and pass it from AddPlaidBankAccount )

  9. shahinyan11 commented on Nov 30, 2023

    @shahinyan11
    Contributor

    Proposal

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

    Android-BA-Tapping connect online with plaid shows 2 spin circles loading

    What is the root cause of that problem?

    The first loader is ours and the second loader is Plaid Link's loader . We can not hide the Plaid link's loader and so that we should hide or custom loader when Plaid link's window displays

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

    We can change this line to following {lodashGet(plaidData, 'isLoading') && !(Boolean(token) && !bankName) && ( to hide our custom loader when the Plaid link window becomes visible

    What alternative solutions did you explore? (Optional)

    We can update ONYXKEYS.PLAID_DATA in useEffect function of PlaidLink component by setting isLoading key to false

  10. Krishna2323 commented on Nov 30, 2023

    @Krishna2323
    Contributor

    Proposal

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

    Android-BA-Tapping connect online with plaid shows 2 spin circles loading

    What is the root cause of that problem?

    The first loading is our custom loader and the second is coming from PlaidLink which can't be hidden.

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

    We need to initialize a new state called isPlaidLinkLoaded. We will show our custom loader only when lodashGet(plaidData, 'isLoading') is true and isPlaidLinkLoaded is false.

    To determine the current state of PlaidLink, we can use the event emitted from the onEvent function. When event === 'OPEN' || event === 'TRANSITION_VIEW', we will set isPlaidLinkLoaded to true. We also need to perform a cleanup function.

    Result

    plaid_loader_demo.mp4
  11. 36 remaining items

  12. melvin-bot commented on Jan 3, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  13. twisterdotcom commented on Jan 4, 2024

    @twisterdotcom
    Contributor

    @Beamanator and @akinwale - is this correct? If so, I can pay out once #33890 is deployed at $250 instead.

  14. twisterdotcom commented on Jan 4, 2024

    @twisterdotcom
    Contributor

    Hmm actually, @marcaaron removed the deployblocker. I'm going to pay this out as normal.

    Payment Summary:
    @akinwale paid $500 here (Reviewer)
    @ZhenjaHorbach paid $500 here (Contributor)

  15. twisterdotcom commented on Jan 4, 2024

    @twisterdotcom
    Contributor

    Just waiting on @akinwale to complete the checklist.

  16. changed the title [-][HOLD for payment 2024-01-02] [$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading[/-] [+][Awaiting checklist completion] [$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading[/+] on Jan 4, 2024
  17. twisterdotcom commented on Jan 8, 2024

    @twisterdotcom
    Contributor
  18. akinwale commented on Jan 8, 2024

    @akinwale
    Contributor

    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:

    • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
    • [@akinwale] 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:
    • [@akinwale] 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 a regression. This is a specific case that was not handled in the code.

    • [@akinwale] Determine if we should create a regression test for this bug.
    • [@akinwale] 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 steps

    • Launch the Expensify app on Android
    • Tap on the profile picture and navigate to Workspaces
    • Select any workspace without a bank account, or create a new workspace if none exist
    • Select Bank account
    • Tap "Connect online with Plaid"
    • Verify that only one loading indicator is displayed during the loading process

    Do we agree 👍 or 👎?

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions