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

supabase / cli / 28097812821
65%
develop: 65%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/develop/pr-5718-64df2ba83785d849fd230ef7aea7cf5a60de63c4
DEFAULT BRANCH: develop
Ran 24 Jun 2026 12:18PM UTC
Jobs 1
Files 228
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

24 Jun 2026 12:16PM UTC coverage: 64.886%. Remained the same
28097812821

push

github

web-flow
fix(stack): retry edge function cold-start to avoid first-request 502 (#5677)

## What

Add a bounded, transport-level retry to the local API proxy's
`/functions/v1/*` route so the first request to an Edge Function does
not surface as a `502 Bad Gateway` while edge-runtime cold-boots its
user worker.

## Why

The proxy forwarded function requests to edge-runtime with no retry,
mapping any transport `HttpClientError` straight to a 502. Edge
functions cold-boot lazily: the first request to a function makes
edge-runtime spin up a user worker, and the connection can be
refused/reset during that window. The runtime's `/_internal/health`
probe answers immediately, so the stack reporting `edge-runtime:
Healthy` does **not** mean a given function is servable yet. The result
is an intermittent one-off 502 on a user's first call — and the same
race made the `packages/stack` edge-function e2e test flaky.

## How

- New `retryColdStart` option on the proxy handler, enabled only on the
functions route (other routes proxy to already-warm services and are
unchanged).
- Retries only transient `TransportError`s, spaced 250ms, bounded to 8
attempts (~2s ceiling).
- Buffers the request body into memory on that route so the request can
be safely re-sent across attempts; a body-read failure returns a 502
instead.

Covered by new `ApiProxy.unit.test.ts` cases: the functions route
retries a reset connection to success, non-functions routes do **not**
retry, and the buffered body is replayed on retry (the last test fails
if the body is streamed instead of buffered).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

10869 of 16751 relevant lines covered (64.89%)

10.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28097812821.1 24 Jun 2026 12:18PM UTC 228
64.89
GitHub Action Run
Source Files on build 28097812821
  • Tree
  • List 228
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28097812821
  • 346fec89 on github
  • Prev Build on develop (#28097589408)
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