• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-flutter / 28444101116
86%

Build:
DEFAULT BRANCH: main
Ran 30 Jun 2026 12:26PM UTC
Jobs 8
Files 80
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Jun 2026 12:25PM UTC coverage: 85.605%. Remained the same
28444101116

push

github

web-flow
fix(functions): drain error responses with a streaming content type (#1480)

## What

When an edge function returns an error status with a `text/event-stream`
content type, the SDK now drains and decodes the body into
`FunctionException.details` instead of handing back an unconsumed
stream.

## Why

The streaming branch assigned the raw stream regardless of status:

```dart
} else if (responseType == 'text/event-stream') {
  data = response.stream;
}
...
throw FunctionException(status: response.statusCode, details: data, ...);
```

On a non-2xx response that meant:
- `details` was the raw `response.stream`, so callers saw `Instance of
'ByteStream'` instead of the actual error body.
- the stream was never consumed, so the underlying connection was left
open (the auto-created `http.Client` can't be reclaimed).

Every other content-type branch already drains via `toBytes()`; only the
event-stream branch returned a live stream. The fix gates that on a
successful status:

```dart
} else if (responseType == 'text/event-stream' &&
    200 <= response.statusCode &&
    response.statusCode < 300) {
  data = response.stream;
} else {
  // drain + decode
}
```

## Not a breaking change

A successful streaming response still returns the live `response.stream`
exactly as before. Only the error path changes — from an unusable stream
+ leaked connection to a decoded body string.

## Tests

Added an `error-sse` route to the test client (status 500,
`text/event-stream`) and a test asserting `invoke()` throws a
`FunctionException` whose `details` is the decoded body (`'error:
boom'`). Without the fix `details` is `Instance of 'ByteStream'` and the
test fails.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

2 of 2 new or added lines in 1 file covered. (100.0%)

4133 of 4828 relevant lines covered (85.6%)

3.74 hits per line

Jobs
ID Job ID Ran Files Coverage
6 supabase_flutter - 28444101116.6 30 Jun 2026 12:27PM UTC 11
78.73
GitHub Action Run
7 functions_client - 28444101116.7 30 Jun 2026 12:26PM UTC 2
98.57
GitHub Action Run
8 supabase - 28444101116.8 30 Jun 2026 12:26PM UTC 15
81.8
GitHub Action Run
7 realtime_client - 28433368938.7 30 Jun 2026 09:15AM UTC 11
88.4
GitHub Action Run
2 gotrue - 28433368938.2 30 Jun 2026 09:15AM UTC 26
84.2
GitHub Action Run
3 yet_another_json_isolate - 28433368938.3 30 Jun 2026 09:12AM UTC 1
79.03
GitHub Action Run
7 storage_client - 28437115472.7 30 Jun 2026 10:20AM UTC 5
92.98
GitHub Action Run
4 postgrest - 28433368938.4 30 Jun 2026 09:14AM UTC 9
84.29
GitHub Action Run
Source Files on build 28444101116
  • Tree
  • List 80
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28444101116
  • 0eeb4130 on github
  • Prev Build on main (#28437115472)
  • Next Build on main (#28444889808)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc