Skip to content

functions.invoke fails when passing in custom Cronet #1149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DanMossa opened this issue Apr 5, 2025 · 0 comments
Open

functions.invoke fails when passing in custom Cronet #1149

DanMossa opened this issue Apr 5, 2025 · 0 comments
Labels
bug Something isn't working functions This issue or pull request is related to functions

Comments

@DanMossa
Copy link
Collaborator

DanMossa commented Apr 5, 2025

Describe the bug
When passing in a custom Http Client to Supabase's instantiation, functions.invoke fail with a 400 error.

FunctionException(status: 400, details: <html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, reasonPhrase: )

To Reproduce

        final engine = CronetEngine.build(
          cacheMode: CacheMode.memory,
          cacheMaxSize: _maxCacheSize,
          enableHttp2: true,
        );
        final client = CronetClient.fromCronetEngine(engine);

    await Supabase.initialize(
      url: Config.supabase.url,
      anonKey: Config.supabase.anonKey,
      authOptions: const FlutterAuthClientOptions(authFlowType: AuthFlowType.implicit),
      httpClient: client,
    );

Supabase.instance.client.functions.invoke('call-edge-function')

Expected behavior
I expect the function to be correctly invoked without an errors, just like it happens when no or a regular HttpClient is passed in

Version (please complete the following information):
supabase_flutter 2.8.3
supabase 2.6.2
functions_client 2.4.0
gotrue 2.11.1
postgrest 2.4.1
realtime_client 2.4.1
storage_client 2.3.0

@DanMossa DanMossa added the bug Something isn't working label Apr 5, 2025
@DanMossa DanMossa changed the title functions.invoke fails when passing in custom httpClient functions.invoke fails when passing in custom Cronet Apr 5, 2025
@dshukertjr dshukertjr added the functions This issue or pull request is related to functions label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working functions This issue or pull request is related to functions
Projects
None yet
Development

No branches or pull requests

2 participants