Skip to content

Callable Function throw Deadline Exceeded Error even on successful response #3289

Closed
@stevecastaneda

Description

[REQUIRED] Describe your environment

  • Operating System version: MacOS Catalina 10.15.5
  • Browser version: Chrome 83.0.4103.116
  • Firebase SDK version: 7.15.5
  • Firebase Product: Functions
  • Issue persists with Node 12.18.1 and 14.4.0

[REQUIRED] Describe the problem

Steps to reproduce:

This is a continuation from issue #2746, and I'm experiencing the same deadline-exceeded error even after Promise.race successfully returns a promise (as evidenced by the callable function returning data as I expect).

@minism

Function Relevant Code: [Typescript]

import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp();

export const helloUser = functions.https.onCall((data, context) => {
  if (context.auth) {
    return { response: "There's a user!", data };
  } else {
    throw new functions.https.HttpsError("permission-denied", "You must be logged in.");
  }
});

Frontend (React)

async function testFunction() {
  try {
        let functionTest = functions.httpsCallable("helloUser");
        let response = await functionTest();
        console.log(response);
      } catch (error) {
        console.log(error);
      }
}

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions