Error appears after enter test credentials on Plaid modal
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Issue is failing PRs https://github.com/Expensify/App/pull/4962 and https://github.com/Expensify/App/pull/5029 (CC @marcaaron)
Action Performed:
- With the app instlalled on the device navigate to staging.new.expensify.com/bank-account/new
- Select the option to log in to bank account
- Enter the test credentials.
Expected Result:
User should be able to use the test credentials and redirected to the bank account selector.
Actual Result:
An internal server error occurred when using the test credentials.
Workaround:
Unknown.
Platform:
Where is this issue occurring?
- Android
- iOS
Version Number: 1.0.93-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/44479856/132071487-c22c4f16-0aac-4888-9d85-8db65182e576.mp4
Expensify/Expensify Issue URL:
Assigned @marcaaron since he's the author of both PRs.
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Is this only happening on Android? It was working fine for me and now suddenly isn't on staging. Since no customers are using this yet we can either revert this or merge it anyway. I'll leave this up to deployers to decide as it's Friday and I don't know if there are plans to deploy a release build or not.
I was only able to check on Android app since iOS bank-account/new link is redirecting to mWeb (mentioned here https://github.com/Expensify/App/pull/5029#issuecomment-912829890) I asked a tester to check on iOS with the new link and will let you know the results.
On the deploy release I think @roryabraham can answer that :)
Same error is reproduced in iOS

Given that:
- This is not yet a user-facing feature
- Before the offending PRs, the modal just wasn't rendering at all (so it's not really broken any worse than it was before)
I think we can demote this from deploy-blocker to regular bug.
So... I'm stumped on this one. But here's what I can say about it:
- I re-tested on dev build + also with staging env variables and it works... totally fine
- Staging web works.. well, fine
- Built a release build for Android and it works... fine
- Went back to try the Play Store beta again and...
Internal error occurred
And that's my cue... have a good weekend everyone 😃
Took another look today and I have verified that:
- Non-sandbox bank connections should work fine on production
- Probably there's some issue with our token endpoint and we are getting rate limited as described here
@kevinksullivan @MitchExpensify do you guys think this is worth prioritizing right now? It basically means that we can't test Plaid using the sandbox credentials on staging versions of the app until resolved.
Did some more testing + looking at logs and noticed that we are actually using the production.plaid.com API endpoint (logs) while using the staging version of the app.
However, the staging version of the app should be pointing to staging-secure.expensify.com which should be using the sandbox.plaid.com endpoint. On the web version of the app the correct endpoint is used. However, it looks like that's not happening for the native app judging from the logs. Pretty confused about why this is happening. 😕
Alright, now I just think maybe this has never worked and we haven't tested it on native. I'm pretty sure we are not using the "staging" environment variables for these builds. @AndrewGable or @Jag96 do either of you guys know?
Yes, I agree. I think TestFlight and Google Play Beta use production end points because we do not build another version, we just move them from TestFlight to production, changing the end points would require a new build
Yes, I agree. I think TestFlight and Google Play Beta use production end points because we do not build another version, we just move them from TestFlight to production, changing the end points would require a new build
Ah ok that makes so much sense thanks for verifying. Mystery solved! I thought I had broken this 😄
It does seem like we're able to detect that we are in the "staging" environment (judging from the STG header badge) so maybe we can have secure calls switch to the staging server in these cases. Will spin something up for that.
It does seem like we're able to detect that we are in the "staging" environment (judging from the STG header badge) so maybe we can have secure calls switch to the staging server in these cases.
Yeah, you can check getEnvironment and betaChecker to see how we handle the badges, I think using the same logic would be the best way to handle that using existing code.
I guess thinking more on this though... is the intention of having a beta version of the app that things like setting up a bank account would work as they do in production? I'm not sure who has access to the beta/test flight versions of the app - but if I was a random public beta tester (or even an internal one) I might be confused about why the app isn't letting me set up a bank account (and the answer would be because we are using a sandbox).
is the intention of having a beta version of the app that things like setting up a bank account would work as they do in production?
Yes, I believe that is the intention.
Got it. Maybe we can add a toggle in settings to switch to the staging secure server? I know there was some discussion about always having staging use the production endpoints. But it makes testing these flows with test credentials impossible. Just not sure how desperate we are to get this working. Will wait for @MitchExpensify @kevinksullivan to chime in before doing anything else.
How do we test this on old.expensify?
On the staging website we just use the staging secure server.
On Mobile-Expensify we hit this page and would be staging or prod based on this which ultimately depends on this which we can toggle with a switch here.
Just following up here. Ended up implementing something similar to what we have in Mobile-Expensify and hid it in the user preferences here:

It should only show on the Google Play / Test Flight versions of the app as it's using the environment checker + basically just forces the API to use staging secure then saves it as a local preference.
Here for the design eyes - can we get some more padding below the language selector and above the test preferences section? Thanks!
Also I think the switch and the label to the left should be vertically centered.