Open
Description
I am testing the new streaming API for cloud functions in emulator.
Aborting streams with an AbortController on my client works fine.
How can the called function know that the user canceled the stream? The CallableResponse signal does not fire an event.
I want to pass an abort signal to the AI API I am calling in the function.
export const aiStreamText = onCall<AiStreamTextRequest>(
async (request, response) => {
response?.signal.addEventListener("abort", () => {
console.log(new Date().toISOString(), "on server: aborted by user"); // THIS DOES NOT FIRE ON ABORT
});
Related issues
[REQUIRED] Version info
node:
firebase-functions:
firebase-tools:
firebase-admin: