Callable Function throw Deadline Exceeded Error even on successful response (original) (raw)

[REQUIRED] Describe your environment

[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);
      }
}