perlsky is a Perl 5 implementation of an AT Protocol Personal Data Server.
13
fork

Configure Feed

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

Cap applyWrites batches at 200

alice d7b6f27e a0d80ac6

+22
+2
lib/ATProto/PDS/API/Repo.pm
··· 65 65 my $body = $c->req->json || {}; 66 66 my ($claims, $account) = _require_repo_owner($c, $body->{repo}); 67 67 my @writes = map { _normalize_apply_writes_input($_) } @{ $body->{writes} || [] }; 68 + xrpc_error(400, 'InvalidRequest', 'Too many writes. Max: 200') 69 + if @writes > 200; 68 70 _assert_oauth_write_permissions($claims, \@writes); 69 71 my $commit = $c->repo_manager->apply_writes( 70 72 $account,
+20
t/repo-api.t
··· 353 353 ->json_is('/cid' => $pre_missing_delete_commit->{cid}) 354 354 ->json_is('/rev' => $pre_missing_delete_commit->{rev}); 355 355 356 + my @too_many_writes = map { 357 + +{ 358 + '$type' => 'com.atproto.repo.applyWrites#create', 359 + collection => 'app.bsky.feed.post', 360 + rkey => sprintf('bulk-%03d', $_), 361 + value => { 362 + '$type' => 'app.bsky.feed.post', 363 + text => "bulk write $_", 364 + createdAt => '2026-03-12T00:00:00Z', 365 + }, 366 + } 367 + } 1 .. 201; 368 + 369 + $t->post_ok('/xrpc/com.atproto.repo.applyWrites' => { Authorization => "Bearer $access" } => json => { 370 + repo => $did, 371 + writes => \@too_many_writes, 372 + })->status_is(400) 373 + ->json_is('/error' => 'InvalidRequest') 374 + ->json_is('/message' => 'Too many writes. Max: 200'); 375 + 356 376 done_testing; 357 377 358 378 sub _start_mock_server {