You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FIXED in 4.6.0] Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume #152
On Cloudflare Workers, the cloudflare:sockets polyfill (cf/polyfills.js) has no pause() or resume(). src/connection.js calls socket.resume() on the first read of a COPY TO stream and socket.pause() under backpressure, so:
sql.subscribe() connects but never delivers a change.
Reproduced in real workerd (Wrangler 4.151.1) at compatibility dates 2025-01-01, 2025-09-15 and 2026-10-12 by the copy-out and subscribe scenarios in tests-startup/workerd-worker.js: run 39149730488 (PR #150). On src/ running over workerd's own node:net, both pass.
Fix on PR #151: the polyfill socket gets pause()/resume(), and its read loop waits after a chunk while paused.
changed the title [-]Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/-][+][FIXED in 4.6.0] Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/+]on Oct 21, 2026
Activity
fix(cf): pause and resume the polyfill socket, and keep reading after…
okomarov commentedon Oct 19, 2026
Fixed on main by 2cf42d9 (#151); ships in the next release.
okomarov commentedon Oct 20, 2026
Rechecked on 3.4.9 in workerd from Wrangler 4.151.1, with only 3.4.9's timer calls patched (porsager#1088):
copy-outfails with porsager#975'ssocket.resume is not a functionat 2025-01-01, 2025-09-15 and 2026-10-12, andsubscribenever delivers (the server rejectsinvalid standby message type "f"). The fork passes both at every date (run https://github.com/steadybrew/postgresjs/actions/runs/39453433731). Ships in the next release; the title gets its version then.docs: list the COPY TO and subscribe() fix on Workers among the fixed…
chore: release 4.6.0-rc1
chore: release 4.6.0
[-]Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/-][+][FIXED in 4.6.0] Cloudflare: COPY TO and subscribe() fail because the socket polyfill has no pause or resume[/+]okomarov commentedon Oct 21, 2026
Shipped in 4.6.0 (
npm install @steadybrew/[email protected]), unchanged from 4.6.0-rc1. The tests that cover it passed in the tag run.