-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Functions custom HttpsError regression from v8 to v9 #9855
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
@mikehardy Thanks again for the detailed report. I'll take a look. For the next Swift API migration, let's try to coordinate running your tests before we release. 😃 |
You can always do it :-) Or just ask of course |
I'm not able to reproduce the issue in our JavaScript-based test harness in #9857. We're still generating It's not immediately clear how to run the TypeScript test. Our integration test infrastructure seems to rely on having an Any suggestions about the best way to get to an Objective-C reproducible example? Whether it's to adapt our integration tests to handle TypeScript, change something about the TypeScript failure case and add it to index.js, or something else. cc: @inlined |
What's the error there? It attempts to compile the functions first, then start the emulator, but we run that in CI via github actions all the time, it must just need a small amount of percussive maintenance somewhere to get it moving... |
maybe change this
to this as in our harness functions? did you already try that? throw new functions.https.HttpsError('invalid-argument', 'Invalid test requested.'); |
Thanks! I can now reproduce. I also had to change from This function in
My JavaScript is weak and TypeScript non-existent, so I appreciate the pointer. 😄 On the other path, I'm still running into issues after installing yarn, starting the Firebase CLI, repeatedly finding and killing hung processes on ports, and running |
This one is a definite breakage in the Obj-C to Swift port. I'm most of the way to a fix and should have a PR up by early next week. |
Step 0: Are you in the right place?
file a GitHub issue.
with the
firebase
tag.google group.
of the above categories, reach out to
Firebase Support.
this repository, please delete this section.
[REQUIRED] Step 1: Describe your environment
CocoaPods
(select one)iOS
[REQUIRED] Step 2: Describe the problem
I'm forward-porting react-native-firebase to firebase-ios-sdk v9+ and I noticed a regression in custom error message behavior.
Prior to v9 here, if a function threw a custom HttpsError, the custom error details would be reflected in the error returned from the SDK, but with v9 all custom errors appear to be mapped to 'INTERNAL', which is the generic HTTP 500 response code mapping
Steps to reproduce:
Code up a simple test cloud function that will return an error if you supply it with nothing, or use ours:
https://github.com/invertase/react-native-firebase/blob/main/.github/workflows/scripts/functions/src/testFunctionDefaultRegion.ts
https://github.com/invertase/react-native-firebase/blob/52715959a375e8babd129baec38356b78ce80ab6/.github/workflows/scripts/functions/src/testFunctionDefaultRegion.ts#L42-L45
Call that cloud function, with no arguments so it will return the custom error:
https://github.com/invertase/react-native-firebase/blob/52715959a375e8babd129baec38356b78ce80ab6/packages/functions/e2e/functions.e2e.js#L175-L185
Relevant Code:
...which goes to this Objective-C code:
https://github.com/invertase/react-native-firebase/blob/52715959a375e8babd129baec38356b78ce80ab6/packages/functions/ios/RNFBFunctions/RNFBFunctionsModule.m#L43-L81
and just returns
internal
instead of the expectedinvalid-argument
code with description from the function. firebase-android-sdk still returns the custom code/messageI threw a log message in to get the raw error from the SDK immediately after it falls into the
if(error)
case:which yields
Looks like something about the Obj-C --> Swift port missed custom error handling somehow?
The text was updated successfully, but these errors were encountered: