firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

FR: add the ability to pass abort signal to httpsCallable

Open makoffd opened this issue 5 years ago • 3 comments

Describe your environment

  • Operating System version: macOs Catalina 10.15.4
  • Browser version: Google Chrome 81.0.4044.129
  • Firebase SDK version: 7.14.3
  • Firebase Product: functions

Describe the problem

It's impossible to cancel the httpsCallable call in response to some user event e.g. button click. The proposed solution is to pass down the abort signal to the fetch invocation as described in MDN AbortSignal docs. The signal parameter could be a part of HttpsCallableOptions.

Relevant Code:

interface HttpsCallableOptions {
    timeout?: number;
    signal?: AbortSignal;
}

const controller = new AbortController();
const abortSignal = controller.signal;

functions.httpsCallable('myFirebaseFunction', {
    signal: abortSignal
});

makoffd avatar May 13 '20 08:05 makoffd

Any update on this one?

somq avatar Nov 17 '23 16:11 somq

This is more relevant with Angular than ever, with the new resource functionality. Please consider implementing this.

its0xFUL avatar Aug 24 '25 09:08 its0xFUL

Yes, this would be super useful for some use-cases to just cancel blocking network calls, even if the underlying firebase functions can't actually be cancelled once running.

tmcdo1 avatar Oct 09 '25 18:10 tmcdo1