sdk-compliance.yaml still marks functions.invocation.streaming_response as partially_implemented. RawInvoke returns HttpContent but the send in RetryExecutor uses the default ResponseContentRead, so the whole body is buffered before it returns. a text/event-stream function (ai chat, progress events) is only readable once it has finished.
js, flutter, swift and kotlin all hand back the live response for text/event-stream:
https://github.com/supabase/supabase-js/blob/master/packages/core/functions-js/src/FunctionsClient.ts
Invoke can't branch on content type and i'd rather not add a flag to it, so a separate method like swift and kotlin have:
Task InvokeStream(string functionName, string? token = null, InvokeFunctionOptions? options = null, CancellationToken cancellationToken = default);
sends with ResponseHeadersRead, no retry once headers arrive, HttpTimeout covers the headers only, caller disposes the response. sse parsing can come later ( at least i propose new issue and new PR for it ) .
upstream is supabase/functions-js#74 from 2024, so not a recent js change
sdk-compliance.yaml still marks functions.invocation.streaming_response as partially_implemented. RawInvoke returns HttpContent but the send in RetryExecutor uses the default ResponseContentRead, so the whole body is buffered before it returns. a text/event-stream function (ai chat, progress events) is only readable once it has finished.
js, flutter, swift and kotlin all hand back the live response for text/event-stream:
https://github.com/supabase/supabase-js/blob/master/packages/core/functions-js/src/FunctionsClient.ts
Invoke can't branch on content type and i'd rather not add a flag to it, so a separate method like swift and kotlin have:
Task InvokeStream(string functionName, string? token = null, InvokeFunctionOptions? options = null, CancellationToken cancellationToken = default);
sends with ResponseHeadersRead, no retry once headers arrive, HttpTimeout covers the headers only, caller disposes the response. sse parsing can come later ( at least i propose new issue and new PR for it ) .
upstream is supabase/functions-js#74 from 2024, so not a recent js change