Skip to content

In Firebase Functions iOS, a Cloud function error 'already-exists' gets treated as 'notFound' #9942

Closed
@tciuro

Description

@tciuro

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.4.1
  • Firebase SDK version: 9.3.0
  • Installation method: CocoaPods
  • Firebase Component: Functions
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

Functions that throw already-exists generate the right HTTP response (seen in Postman as HTTP 409 Conflict). However, in the iOS client bubbles the error to the client as notFound. The commit mentioned below shows the affected areas and includes a fix.

Steps to reproduce:

Simple. Just throw the following from a Cloud Function:

throw new functions.https.HttpsError('already-exists', 'Resource exists')

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

https://github.com/firebase/firebase-ios-sdk/commit/3e758246f6c25001cb9f36ac9b429101a59219c7 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close