Compare commits

..
1 Commits
Author SHA1 Message Date
thepraandClaude Opus 5.5 123ba39520 A post whose author cannot be shown is left out of a list, never a 500
Build / Build (push) Successful in 4m19s
Deploy / privapub.thepra.dev (push) Successful in 4m50s
The v1.19.0 deploy's tests failed where build.yml's passed. A test stored a public remote post with no author id, and
when the public timeline test ran after it, MastodonMapper.Statuses looked that null up in its accounts and answered
500. The mapper now skips such a post, and the test stores a real author.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELjqpznMFMNrJoJUj6K5p2
2026-10-04 03:46:48 +02:00
2 changed files with 5 additions and 3 deletions

No files matched your search

+3 -1
View File
@@ -195,11 +195,13 @@ namespace PrivaPub.Tests.Federation
entity.Members.Add(new GroupMember { AvatarId = bob.Id }); entity.Members.Add(new GroupMember { AvatarId = bob.Id });
await DB.Default.SaveAsync(entity, token); await DB.Default.SaveAsync(entity, token);
var outsider = new RemoteActor(_harness.Peer, "asked"); var outsider = new RemoteActor(_harness.Peer, "asked");
await _harness.Remote.GetActor(outsider.Id, refresh: false, token); var outsiderAccount = await _harness.Remote.GetActor(outsider.Id, refresh: false, token);
var asksFirst = new Post var asksFirst = new Post
{ {
ObjectURI = $"{Origin(outsider)}/notes/{Guid.NewGuid():N}", ObjectURI = $"{Origin(outsider)}/notes/{Guid.NewGuid():N}",
ActorURI = outsider.Id, ActorURI = outsider.Id,
GroupUserId = outsiderAccount.ID,
AuthorAccountId = outsiderAccount.ID,
IsFederatedCopy = true, IsFederatedCopy = true,
Visibility = PostVisibility.Public, Visibility = PostVisibility.Public,
ContentHtml = "<p>ask me first</p>", ContentHtml = "<p>ask me first</p>",
@@ -202,8 +202,8 @@ namespace PrivaPub.Api.Mastodon.Mappers
Status Map(PostEntity post) Status Map(PostEntity post)
{ {
if (!accounts.TryGetValue(AuthorOf(post), out var account)) if (AuthorOf(post) is not { } author || !accounts.TryGetValue(author, out var account))
return default; return default;//a post whose author we cannot show is left out, never a 500
var status = new Status var status = new Status
{ {
Id = post.ID, Id = post.ID,