-
Notifications
You must be signed in to change notification settings - Fork 891
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
httpsCallable error code format change from v8 to v9 should be warned loudly #6281
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
On the other hand, error code in firestore does not have a prefix, which seems inconsistent with functions one. |
What makes this problem worse is that the TypeScript definitions do not reflect the change and are currently different from actual runtime behavior. Adjusting the types would warn developers about the breaking change. Please tell me if I should open a PR. |
That can be done, but we need to keep the non-prefixed type around as a param type for the FunctionsError constructor here:
Seems like there's a fancy Typescript way of making a type that extends that type and adds the prefix, which can be used as the public type for FunctionsError. Feel free to make a PR or I will try to get to it when I can.
I think we try to wrap every error thrown by an SDK in the appropriate custom error wrapper for that product, but we may have missed some or not caught some errors that aren't thrown directly by the SDK code. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
v8:
firebase-js-sdk/packages/functions/test/callable.test.ts
Line 50 in 919413c
v9:
firebase-js-sdk/packages/functions-compat/src/callable.test.ts
Line 40 in cdada6c
The change of error code format (it attaches "functions/" at the beginning since v9) is not mentioned in the v8 v9 migration guide. It should be well announced in the documentation.
Otherwise, if a user relies on the error code string in their app, the upgrade will cause a crush (like me 😢 ).
Steps to reproduce:
Relevant Code:
// TODO(you): code here to reproduce the problem
The text was updated successfully, but these errors were encountered: