diff --git a/internal/atproto/jetstream/authorpost.go b/internal/atproto/jetstream/authorpost.go index e122c7a..e5d20ad 100644 --- a/internal/atproto/jetstream/authorpost.go +++ b/internal/atproto/jetstream/authorpost.go @@ -62,7 +62,7 @@ const PostV2Collection = posts.PostV2Collection // local write API caps in internal/core/posts/service.go. const ( MaxPostTitleBytes = 3000 - MaxPostContentBytes = 100000 + MaxPostContentBytes = 500000 ) // DeletedAccountLookup reports whether a DID names an account this AppView was diff --git a/internal/atproto/jetstream/postv2_content_cap_test.go b/internal/atproto/jetstream/postv2_content_cap_test.go index 6dbadf9..9ed43b1 100644 --- a/internal/atproto/jetstream/postv2_content_cap_test.go +++ b/internal/atproto/jetstream/postv2_content_cap_test.go @@ -28,10 +28,10 @@ func TestPostV2Consumer_ContentAndTitleCapsApplyToCreateAndUpdate(t *testing.T) content string }{ { - name: "content over 100000 bytes", + name: "content over 500000 bytes", rkey: "pv2contentovercap", title: "oversized content", - content: strings.Repeat("c", 100_001), + content: strings.Repeat("c", 500_001), }, { name: "title over 3000 bytes", @@ -57,7 +57,7 @@ func TestPostV2Consumer_ContentAndTitleCapsApplyToCreateAndUpdate(t *testing.T) }) } - t.Run("update/content over 100000 bytes", func(t *testing.T) { + t.Run("update/content over 500000 bytes", func(t *testing.T) { const ( rkey = "pv2updatecontentovercap" originalContent = "content before the oversized update" @@ -72,11 +72,11 @@ func TestPostV2Consumer_ContentAndTitleCapsApplyToCreateAndUpdate(t *testing.T) err := f.consumer.HandleEvent(ctx, pv2Event( pv2Author, "update", rkey, revs[1], "bafyreicapupdatev2", base+1_000_000, - pv2Record(pv2Community, "updated title", strings.Repeat("u", 100_001)), + pv2Record(pv2Community, "updated title", strings.Repeat("u", 500_001)), )) assert.Truef(t, errors.Is(err, ErrPermanentEvent), - "a postv2 update with content over 100,000 bytes must return ErrPermanentEvent; got %v", err) + "a postv2 update with content over 500,000 bytes must return ErrPermanentEvent; got %v", err) assert.ErrorContains(t, err, "exceeds maximum length", "the oversized update rejection must name the content cap") var contentUnchanged bool @@ -96,12 +96,12 @@ func TestPostV2Consumer_ContentAndTitleCapsApplyToCreateAndUpdate(t *testing.T) wantContent int }{ { - name: "content at 100000 bytes", + name: "content at 500000 bytes", rkey: "pv2contentatcap", title: "content boundary", - content: strings.Repeat("c", 100_000), + content: strings.Repeat("c", 500_000), wantTitle: len("content boundary"), - wantContent: 100_000, + wantContent: 500_000, }, { name: "title at 3000 bytes",