firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

[FR] allow to abort using AbortSignal

Open rluvaton opened this issue 2 years ago • 3 comments

Describe the solution you'd like when sending push notifications using the messaging module, I would like to be able to pass AbortSignal so that I can abort the request with it

rluvaton avatar Apr 04 '23 14:04 rluvaton

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Apr 04 '23 14:04 google-oss-bot

Hello @rluvaton , thanks for filing the feature request. I'd like to know more about the feature. My current understanding is:

  • In sending a message you can attach AbortSignal being a string label you defined
  • You can send another request with the same string label to cancel the previous send (assume if it hasn't reached out to the client yet)

Is my understanding correct? If so I think our backend cannot support it due to various reasons.

chong-shao avatar Apr 07 '23 20:04 chong-shao

What I mean is that we should be able to pass to every API function here (e.g. sending push notification) an AbortSignal that will propagate to the request call (should be part of the options)

https://github.com/firebase/firebase-admin-node/blob/b7de8a1330f6a32c11a7dc590b6775fde45ebb39/src/utils/api-request.ts#L487

NodeJS Docs | http.request signal param

rluvaton avatar Apr 10 '23 15:04 rluvaton