Functions: Add in function streaming#1478
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Server-Sent Event (SSE) streaming support for callable functions in the Firebase Unity SDK, adding the StreamAsync API and a new StreamResponse class, along with corresponding integration tests and dependency updates. The review feedback highlights two important improvements in HttpsCallableReference.cs: first, the HttpResponseMessage returned by SendAsync should be disposed to prevent connection leaks when using HttpCompletionOption.ResponseHeadersRead; second, a null check should be added for response.Content before reading the stream to avoid potential null reference exceptions.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Callable Functions Streaming in Firebase Functions via the new StreamAsync API, utilizing Server-Sent Events (SSE). It includes the implementation of StreamResponse to represent intermediate messages and final results, SSE stream parsing logic, and corresponding integration tests. Feedback on the changes suggests improving the streaming implementation by properly disposing of HttpRequestMessage, combining cancellation tokens, and ensuring responsive cancellation during stream reads.
9999fb1 to
816f635
Compare
816f635 to
ea637f7
Compare
Description
Functions: Add in function streaming
Testing
Ran the test locally in unity editor and created a new integration test
Type of Change
Place an
xthe applicable box: