atproto pds in zig pds.zat.dev
pds atproto
24

Configure Feed

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

Handle large applyWrites bodies

zzstoatzz (Jun 15, 2026, 12:50 AM -0500) b408a9e5 f78cf8e7

+5 -2
+5 -2
src/atproto/repo.zig
··· 8 8 const zat = @import("zat"); 9 9 10 10 const http = std.http; 11 + const max_apply_writes_body_len = 5 * 1024 * 1024; 11 12 12 13 pub fn createRecord(request: *http_api.Request) !void { 13 14 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); ··· 190 191 191 192 const auth_ctx = requireAccount(request, allocator) catch return; 192 193 const account = auth_ctx.account; 193 - var body_buf: [131072]u8 = undefined; 194 - const body = try http_api.readBody(request, &body_buf); 194 + const body = http_api.readBodyAlloc(request, allocator, max_apply_writes_body_len) catch |err| switch (err) { 195 + error.BodyTooLarge => return http_api.xrpcError(request, .payload_too_large, "InvalidRequest", "applyWrites body is too large"), 196 + else => return err, 197 + }; 195 198 const parsed = try http_api.parseJsonBody(request, allocator, body); 196 199 try requireRepoMatches(request, account, parsed.value); 197 200 const writes = switch (parsed.value) {