Skip to content

Functions: Add in function streaming#1478

Open
AustinBenoit wants to merge 9 commits into
mainfrom
functionsStreaming
Open

Functions: Add in function streaming#1478
AustinBenoit wants to merge 9 commits into
mainfrom
functionsStreaming

Conversation

@AustinBenoit

Copy link
Copy Markdown
Contributor

Description

Provide details of the change, and generalize the change in the PR title above.

Functions: Add in function streaming


Testing

Describe how you've tested these changes.

Ran the test locally in unity editor and created a new integration test


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread functions/src/HttpsCallableReference.cs Outdated
Comment thread functions/src/HttpsCallableReference.cs
@AustinBenoit

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread functions/src/HttpsCallableReference.cs Outdated
@AustinBenoit AustinBenoit force-pushed the functionsStreaming branch 2 times, most recently from 816f635 to ea637f7 Compare June 29, 2026 15:44
@AustinBenoit AustinBenoit requested a review from a-maurice June 29, 2026 17:29
Comment thread functions/src/Internal/FunctionsSerializer.cs
Comment thread functions/testapp/Assets/Firebase/Sample/Functions/.functions/functions/index.js Outdated
Comment thread functions/testapp/functions/functions/index.js
@wiz-9635d3485b

wiz-9635d3485b Bot commented Jul 7, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 1 High 1 Medium
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 High 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@AustinBenoit AustinBenoit added the tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). label Jul 7, 2026
@AustinBenoit AustinBenoit added tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). and removed tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). labels Jul 7, 2026
@github-actions github-actions Bot added the tests: failed This PR's integration tests failed. label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Integration test with FLAKINESS (succeeded after retry)

Requested by @firebase-workflow-trigger[bot] on commit e0573c4
Last updated: Tue Jul 7 19:53 PDT 2026
View integration test log & download artifacts

Failures Configs
messaging [TEST] [FLAKINESS] [2021] [1/2 Build OS(s): windows] [1/2 Platform(s): 2022] [1/7 Test Device(s): Android]

@AustinBenoit AustinBenoit added tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). and removed tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). tests: failed This PR's integration tests failed. labels Jul 7, 2026
@github-actions github-actions Bot added the tests: succeeded This PR's integration tests succeeded. label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests: succeeded This PR's integration tests succeeded. tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants