Skip to content

fix(dataconnect): fix deserialization of emulator gRPC error codes into detailed errors#3180

Open
stephenarosaj wants to merge 2 commits into
mainfrom
rosa/emulator-error-fix
Open

fix(dataconnect): fix deserialization of emulator gRPC error codes into detailed errors#3180
stephenarosaj wants to merge 2 commits into
mainfrom
rosa/emulator-error-fix

Conversation

@stephenarosaj

@stephenarosaj stephenarosaj commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

✨ Added gRPC status code mapping to ensure error responses from the local Data Connect emulator are correctly deserialized. Before these changes, when using the emulator, errors are improperly deserialized into DataConnectErrors with unknown-error instead of ones with detailed code and message fields.

Verified by running the integration tests against the emulator (and production) before and after the changes. What was broken is now fixed!

Changes

  • Added GRPC_STATUS_CODE_TO_STRING mapping dictionary
  • Updated toFirebaseError to handle root-level gRPC error responses
  • Added FDC emulator debug log files to .gitignore

Testing

  • Currently, integration tests fail against the emulator. Now they pass.
  • Added unit test verifying deserialization of transcoded gRPC numeric error codes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for handling gRPC-to-HTTP transcoded error responses in the Data Connect API client by mapping numeric gRPC status codes to their string equivalents. It also updates .gitignore to exclude local debug logs and adds a unit test to verify the new error-handling behavior. A critical issue was identified in the error parsing logic where a null error property in the response could lead to a TypeError and crash the error-handling flow; a code suggestion was provided to safely handle this scenario.

Comment thread src/data-connect/data-connect-api-client-internal.ts Outdated
@dconeybe

Copy link
Copy Markdown

ultranit: looks like there may be some mismatched backticks in the PR description (see attached screenshot)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants