-
Notifications
You must be signed in to change notification settings - Fork 151
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
onExit
can return an undefined
error
#207
Comments
hi @ekilah I really appreciate this very keen eye here. Just from personal experience with Typescript, I would highly recommend never distinguishing between That said I am going to file a ticket internally for this. I suspect we would much rather just fix this clearly undesirable behavior of the SDK than add undefined as a possible error value here. Does the |
A screenshot of what we log to our error reporting service from one of the occurrences we had of this, before I fixed it, shows that the We don't currently log the Plaid request IDs, and I've since fixed the error on our end, so I probably won't be able to produce those for you unfortunately.
Your call, though until/unless this is resolved, others might hit this issue, and adding Anyway, thanks for the reply! Sorry I can't provide those IDs for you. If I can do anything else to help, let me know! Re: TS thoughts (more of a for-fun response, not super important to the topic at hand) I agree in general that a language having two nullish types like JS does is tricky, and is best navigated with caution. That's especially true when writing code against third-party libraries. However, using TypeScript is a great way to avoid errors with mishandling them, as long as typings are correctly describing the possibilities. If the typings from Plaid were correctly including That's why I made the issue here - I disagree that |
note to self: wonder if this is related to #204 👀 |
hey @ekilah I chatted with the team yesterday. We definitely want to fix this and always return just Thanks for the issue report! |
@ekilah can you tell me if you have seen any instances of this in the last ~2 weeks in production environment? we finally rolled out the architectural change I was talking about above which should resolve the |
Hi @skylarmb - unfortunately, I can't tell you one way or another, since I fixed/prevented this on our side when I reported this. But, glad to hear it's fixed upstream! 🥳 |
The typings suggest that the
error
can benull | PlaidLinkError
in theonExit
callback. I've got bug reports from my production environment that suggest thaterror
is occasionally/rarelyundefined
instead ofnull
.Here's an example stack trace where we had a crash after we were filtering out
error !== null
explicitly:Obviously a check for
if (error)
will work fine, so I expect many developers wouldn't even notice.Assuming that this is actually an expected situation, it suggests there are deeper issues with the typings in the library. An obvious but probably incomplete fix is to change the
types.ts
file to also includeundefined
, so I wanted to make an issue first to see if anyone could figure out the rest.The text was updated successfully, but these errors were encountered: