atproto utils for zig zat.dev
atproto sdk zig

tags

v0.3.0-alpha.11

websocket.zig bumped to 104608b — adds Client.isClosed() accessor.

this release pairs with a zlay subscriber.zig fix for the GPF crash
that occurs every ~60-90s in production:

**root cause**: pingLoop swallows error.Canceled from io.sleep(),
so ping_future.cancel() cannot stop the task before client.deinit()
frees the underlying stream/TLS buffers. pingLoop then calls
writeFrame on freed memory → GPF.

**fix (two parts)**:
1. zlay subscriber.zig: `io.sleep(...) catch {}` → `catch return`
— makes pingLoop cancellation-cooperative
2. websocket client: `isClosed()` check before writeFrame
— defense-in-depth against writes to dead connections

zlay needs three changes for this deploy:
1. bump websocket dep: `zig fetch --save=websocket https://github.com/zzstoatzz/websocket.zig/archive/104608b.tar.gz`
2. bump zat dep: `zig fetch --save=zat https://tangled.org/zat.dev/zat/archive/v0.3.0-alpha.11.tar.gz`
3. the subscriber.zig pingLoop fix (already applied in the zlay repo)

all four crash fixes are now in:
- startup SIGSEGV (Io.Threaded backend) — alpha.9
- pg pool multi-waiter panic (futex counter) — alpha.9
- httpFallback for health probes on port 3000 — alpha.10
- pingLoop use-after-free on connection teardown — this release

artifacts

v0.3.0-alpha.10

websocket.zig bumped to 4222f98 — adds httpFallback dispatch.

plain HTTP requests (health probes, XRPC endpoints) on port 3000 now
reach the application handler instead of getting a 400 from the
websocket handshake parser. this was the last deployment blocker
after the three crash fixes in alpha.9.

- zlay needs both deps updated to resolve the diamond dependency:
websocket.zig → 4222f98
zat → v0.3.0-alpha.10
- after updating, `zig build` is sufficient — no code changes in
zlay are needed. the httpFallback handler signature in
broadcaster.zig already matches.
- health probes on port 3000 (/_healthz, /_readyz) should return
200 again. port 3001 MetricsServer probes also still work as
a fallback.
- the three crash fixes from alpha.9 are preserved (client write
lock, pool futex, Threaded backend).

- removed std.debug.print from test code that was corrupting the
zig 0.16 build runner IPC protocol (caused "failed command"
in `zig build test` output despite tests passing).

artifacts