You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
The text was updated successfully, but these errors were encountered:
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 have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
After attempting this for myself, I'm not sure this is possible, however, I will raise internally to confirm. For now, I will leave a feature-request label.
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.
Related issues
[REQUIRED] Version info
node:
firebase-functions:
firebase-tools:
firebase-admin:
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
The text was updated successfully, but these errors were encountered: