Experimental functions._invokeWithStreamedResponse
never yields data
#523
Labels
bug
Something isn't working
functions._invokeWithStreamedResponse
never yields data
#523
Bug report
Describe the bug
When utilizing the experimental
functions. _invokeWithStreamedResponse
method (introduced in #346), the returnedAsyncThrowingStream
never yields any data to the consumer.To Reproduce
Initialize
_invokeWithStreamedResponse
with an edge-function configured to send a text stream (e.g. the Deno SSE template should suffice).Expected behavior
As bytes are decoded from the underlying
NSURLSession
they are yielded to the consumer.System information
Additional context
The current implementation of
_invokeWithStreamedResponse
creates asession.dataTask
with a callback:supabase-swift/Sources/Functions/FunctionsClient.swift
Lines 201 to 217 in fa8db0c
however, it is also specifying a
URLSession
delegate which is responsible for yielding data:supabase-swift/Sources/Functions/FunctionsClient.swift
Line 197 in fa8db0c
According to the docs, if a
dataTask
is specified with a callback, then the delegate is never used, which would explain why values are never yielded:Patching the library to no longer use the callback resolved my issue: kirkbyo@70959a3
The text was updated successfully, but these errors were encountered: