firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.29k stars 1.4k forks source link

Functions chunky response #12914

Open nmalevich opened 1 week ago

nmalevich commented 1 week ago

Description

I write response by chunks. On my local server it works, but Firebase Function return response only after "res.end()"

exports.cloudFunctionEntryPoint = async (req, res) => {
    setTimeout(()=>{
        res.write("1\n");
    }, 1000)
    setTimeout(()=>{
        res.write("2\n");
    }, 2000)
    setTimeout(()=>{
        res.write("3\n");
    }, 3000)
    setTimeout(()=>{
        res.write("4\n");
    }, 4000)
    setTimeout(()=>{
        res.write("5\n");
        res.end();
    }, 5000)
}

Reproducing the issue

No response

Firebase SDK Version

10.25.0

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Functions

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 1 week ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

rizafran commented 1 week ago

Hi @nmalevich, could you provide a code snippet of your Firebase Functions and iOS code invoking the function so I could reproduce it on my end? Thanks.

nmalevich commented 1 week ago

Thank you for your reply. My general question about having possibility to implement streaming data(sending response by chunks)