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

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Nov 30, 2023 · 35 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 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.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
@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 Nov 30, 2023
@melvin-bot melvin-bot bot 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 Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0196db5598b3527ce7

Copy link

melvin-bot bot commented Nov 30, 2023

Triggered auto assignment to @twisterdotcom (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 Nov 30, 2023
Copy link

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

Copy link

melvin-bot bot commented Nov 30, 2023

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Nov 30, 2023

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 )

@shahinyan11
Copy link

shahinyan11 commented Nov 30, 2023

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 30, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
@twisterdotcom
Copy link
Contributor

@akinwale would love your thoughts on the proposals.

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@akinwale
Copy link
Contributor

akinwale commented Dec 4, 2023

I suggest going with @ZhenjaHorbach's proposal since a refactor will result in clearer, more readable code making it easier to understand return paths.

🎀 👀 🎀 C+ reviewed.

Copy link

melvin-bot bot commented Dec 4, 2023

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

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

melvin-bot bot commented Dec 6, 2023

📣 @akinwale 🎉 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 Dec 6, 2023

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@ZhenjaHorbach
Copy link
Contributor

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

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

PR will be ready today or tomorrow

@Krishna2323
Copy link
Contributor

@akinwale @Beamanator, refactoring wasn't the solution, the PR has a completely different approach. I believe my proposal is clearer and more trustworthy here.

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Dec 17, 2023

For all three components, we use plaidData
Which can have different states which we get from backEnd

So we don't have cases when we show PlaidLink but have error

-isLoader (Loader)
-bankName (PlaidLink)
-Error (Text error)

optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PLAID_DATA,
value: {
isLoading: true,
errors: null,
bankName,
},
},
],
successData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PLAID_DATA,
value: {
isLoading: false,
errors: null,
},
},
],
failureData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PLAID_DATA,
value: {
isLoading: false,
},
},
],

So my idea was to follow this logic and expected only one result

And instead of arguing
Let's wait for the decision С+ )

@mountiny
Copy link
Contributor

@akinwale @ZhenjaHorbach Based on the comment from the QA here the issue did not get resolved on Desktop. Would you be able to take a look into this one?

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Dec 25, 2023

@mountiny
If testers report about this issue

Screen.Recording.2023-12-26.at.00.47.51.mov

Then everything is fine
It's other bug which will be fixed in this PR
#33337

@mountiny
Copy link
Contributor

That is apparently it so we are good

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2023
@melvin-bot melvin-bot bot changed the title [$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading [HOLD for payment 2024-01-02] [$500] Android-BA-Tapping connect online with plaid shows 2 spin circles loading Dec 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 26, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

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

Copy link

melvin-bot bot commented Dec 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.16-5 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-01-02. 🎊

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 Dec 26, 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:

  • [@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:
  • [@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.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Daily KSv2 labels Jan 1, 2024
Copy link

melvin-bot bot commented Jan 3, 2024

⚠️ 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.

@twisterdotcom
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Overdue label Jan 4, 2024
@twisterdotcom
Copy link
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)

@twisterdotcom
Copy link
Contributor

Just waiting on @akinwale to complete the checklist.

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Jan 4, 2024
@twisterdotcom twisterdotcom 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 Jan 4, 2024
@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@twisterdotcom
Copy link
Contributor

Bump @akinwale

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@akinwale
Copy link
Contributor

akinwale commented Jan 8, 2024

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
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants