Skip to content

Conversation

@valt-x
Copy link
Contributor

@valt-x valt-x commented Nov 27, 2025

Add timeout option to Supabase.Functions.invoke/3
Support for custom timeout values (defaults to 15 seconds)

still its looks hard cuz js has native choices ,even super heros has some drawbacks
Resolves #4

- Add timeout option to Supabase.Functions.invoke/3
- Support for custom timeout values (defaults to 15 seconds)
- Pass timeout to underlying HTTP client via receive_timeout option
- Maintain backward compatibility with existing API
- Add comprehensive tests for timeout functionality
- Update documentation with timeout examples

Resolves supabase-community#4
@zoedsoupe
Copy link
Member

thanks for the contribution!

@zoedsoupe
Copy link
Member

did you validate that only the receive_timeout is sufficient? as we're always using Fetcher.stream, then probably yes, but it would be nice to ensure that also request_timeout isn't necessary since when not passing on_response callback

as far as i know receive_timeout is only for streaming and the internal message passing timeout from Finch

@valt-x
Copy link
Contributor Author

valt-x commented Nov 27, 2025

Thanks for your response

Yeah receive timeout is not needed for now just added for future uses like passing messages between rpc and functions or inter messages and importantly chain requests

If you don't need , tell me I will remove it

@zoedsoupe
Copy link
Member

ok, makes sense, but that is sufficient for implementing timeout? maybe we can add the request_timeout option too with the same value? wdyt?

@valt-x
Copy link
Contributor Author

valt-x commented Nov 28, 2025

Good catch! Looking at Finch docs:

 * receive_timeout: per-chunk timeout (15s default)
 * request_timeout: overall response timeout (infinity default, HTTP/1 only)

Since we want comprehensive timeout support, I should add both. The current
implementation only handles chunk timeouts but not overall request timeouts.
I'll update to include both options with the same timeout value.

@zoedsoupe zoedsoupe merged commit 9d8338b into supabase-community:main Nov 28, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add request cancellation/timeout support

2 participants