atproto utils for zig
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

bump websocket.zig to 4222f98 (httpFallback dispatch), fix test IPC

websocket.zig change: plain HTTP requests on the websocket port are now
dispatched to Handler.httpFallback() instead of getting a 400 response.
this restores health probe / XRPC support on port 3000 that was lost
in the 0.16 fork migration.

also removes std.debug.print calls from test code — these corrupted
the zig 0.16 --listen=- IPC protocol between the build runner and
test binary, causing spurious "failed command" output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz 4850ec9a 1eb34563

+15 -26
+3 -3
build.zig.zon
··· 1 1 .{ 2 2 .name = .zat, 3 - .version = "0.3.0-alpha.7", 3 + .version = "0.3.0-alpha.10", 4 4 .fingerprint = 0x8da9db57ee82fbe4, 5 5 .minimum_zig_version = "0.16.0", 6 6 .dependencies = .{ 7 7 .websocket = .{ 8 - .url = "https://github.com/zzstoatzz/websocket.zig/archive/0261b7d.tar.gz", 9 - .hash = "websocket-0.1.0-ZPISddmnAwDF1Jjj9X9ICO8sAJetd3-rdRUA-vCzYfwF", 8 + .url = "https://github.com/zzstoatzz/websocket.zig/archive/4222f98.tar.gz", 9 + .hash = "websocket-0.1.0-ZPISdQTUAwDJt7jFEbYJhdqRBztn8mHIFh-dNK5dOlxL", 10 10 }, 11 11 .@"atproto-interop-tests" = .{ 12 12 .url = "https://github.com/bluesky-social/atproto-interop-tests/archive/35bb5638ab1e5ce71fb88a0c95953fc557ef1925.tar.gz",
+4 -7
src/internal/identity/did_resolver.zig
··· 117 117 defer resolver.deinit(); 118 118 119 119 const did = Did.parse("did:plc:z72i7hdynmk6r22z27h6tvur").?; 120 - var doc = resolver.resolve(did) catch |err| { 121 - // network errors are ok in CI, but compilation must succeed 122 - std.debug.print("network error (expected in CI): {}\n", .{err}); 123 - return; 120 + var doc = resolver.resolve(did) catch { 121 + return; // network error, expected in CI 124 122 }; 125 123 defer doc.deinit(); 126 124 ··· 135 133 defer resolver.deinit(); 136 134 137 135 const did = Did.parse("did:plc:z72i7hdynmk6r22z27h6tvur").?; 138 - var doc = resolver.resolve(did) catch |err| { 139 - std.debug.print("network error (expected in CI): {}\n", .{err}); 140 - return; 136 + var doc = resolver.resolve(did) catch { 137 + return; // network error, expected in CI 141 138 }; 142 139 defer doc.deinit(); 143 140
+6 -12
src/internal/identity/handle_resolver.zig
··· 168 168 169 169 // resolve a known handle that has .well-known/atproto-did 170 170 const handle = Handle.parse("jay.bsky.social") orelse return error.InvalidHandle; 171 - const did = resolver.resolveHttp(handle) catch |err| { 172 - // network errors are ok in CI without network access 173 - std.debug.print("network error (expected in some CI): {}\n", .{err}); 174 - return; 171 + const did = resolver.resolveHttp(handle) catch { 172 + return; // network error, expected in CI 175 173 }; 176 174 177 175 // should be a valid did:plc ··· 187 185 defer resolver.deinit(); 188 186 189 187 const handle = Handle.parse("seiso.moe") orelse return error.InvalidHandle; 190 - const did = resolver.resolveDns(handle) catch |err| { 191 - // network errors are ok in CI without network access 192 - std.debug.print("network error (expected in some CI): {}\n", .{err}); 193 - return; 188 + const did = resolver.resolveDns(handle) catch { 189 + return; // network error, expected in CI 194 190 }; 195 191 196 192 // should be a valid DID ··· 206 202 defer resolver.deinit(); 207 203 208 204 const handle = Handle.parse("jay.bsky.social") orelse return error.InvalidHandle; 209 - const did = resolver.resolve(handle) catch |err| { 210 - // network errors are ok in CI without network access 211 - std.debug.print("network error (expected in some CI): {}\n", .{err}); 212 - return; 205 + const did = resolver.resolve(handle) catch { 206 + return; // network error, expected in CI 213 207 }; 214 208 215 209 // should be a valid DID
+2 -4
src/internal/repo/repo_verifier.zig
··· 476 476 var arena = std.heap.ArenaAllocator.init(std.testing.allocator); 477 477 defer arena.deinit(); 478 478 479 - const result = verifyRepo(std.Options.debug_io, arena.allocator(), "zzstoatzz.io") catch |err| { 480 - std.debug.print("network error (expected in CI): {}\n", .{err}); 481 - return; 479 + const result = verifyRepo(std.Options.debug_io, arena.allocator(), "zzstoatzz.io") catch { 480 + return; // network error, expected in CI 482 481 }; 483 482 484 483 try std.testing.expectEqualStrings("did:plc:xbtmt2zjwlrfegqvch7fboei", result.did); 485 484 try std.testing.expect(result.record_count > 0); 486 - std.debug.print("verified zzstoatzz.io: {d} records, rev={s}\n", .{ result.record_count, result.commit_rev }); 487 485 } 488 486 489 487 test "verifyCommitDiff: build tree, serialize partial CAR, verify inversion" {