Expand webmentions source and target columns to text

Long brid.gy Bluesky source URLs exceed 255 characters, causing
SQLSTATE[22001] errors. Changed source and target from varchar(255)
to text (no performance impact in PostgreSQL).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jonny Barnes 2026-03-14 16:32:22 +00:00
commit 0a13d27d6f
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 60 additions and 2 deletions

View file

@ -195,6 +195,38 @@ class ProcessWebMentionJobTest extends TestCase
]);
}
#[Test]
public function webmention_with_long_source_url_gets_saved(): void
{
Queue::fake();
$parser = new Parser;
$html = <<<'HTML'
<div class="h-entry">
I liked <a class="u-like-of" href="/notes/1">a note</a>.
</div>
HTML;
$html = str_replace('href="', 'href="' . config('app.url'), $html);
$mock = new MockHandler([
new Response(200, [], $html),
]);
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$note = Note::factory()->create();
// Simulate a long brid.gy Bluesky source URL (well over 255 characters)
$source = 'https://brid.gy/comment/bluesky/did:plc:n3jhgiq2ykctnpgzlm6p6b25/at%253A%252F%252Fdid%253Aplc%253An3jhgiq2ykctnpgzlm6p6b25%252Fapp.bsky.feed.post%252F3mfekjuhykb2k/at%253A%252F%252Fdid%253Aplc%253Afsfuwigo5juzdwp23hyianzg%252Fapp.bsky.feed.post%252F3mfemw4rrvs2t';
$job = new ProcessWebMention($note, $source);
$job->handle($parser, $client);
$this->assertGreaterThan(255, strlen($source));
$this->assertDatabaseHas('webmentions', [
'source' => $source,
]);
}
#[Test]
public function webmention_repost_gets_deleted_when_repost_of_value_changes(): void
{