A boost reaches the author's server once
A boost and its undo went to the author's personal inbox and to the shared inbox of its server's followers: two copies at once, which Misskey counted twice as it processed them and undid once (seen in decePub's e2e boost on Misskey). The author's server now gets them through its shared inbox, as Mastodon sends them; a like still goes to the author's own inbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
cafd2e6db3
commit
864dae4469
2 files changed
+32
-4
No files matched your search
@@ -487,7 +487,7 @@ namespace PrivaPub.Domain.Statuses
|
||||
if (!original.IsFederatedCopy)
|
||||
await Notifications.Add(original.GroupUserId, NotificationType.Reblog, me.Id, me.Uri, original.ID, token);
|
||||
await _fanout.Distribute(reblog, token);
|
||||
await _delivery.EnqueueToFollowers(me, announce, token, await AuthorInbox(original, token) is { } inbox ? new[] { inbox } : default);
|
||||
await _delivery.EnqueueToFollowers(me, announce, token, await AuthorInbox(original, token, shared: true) is { } inbox ? new[] { inbox } : default);
|
||||
return new StatusOutcome(reblog);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace PrivaPub.Domain.Statuses
|
||||
await DB.Default.DeleteAsync<TimelineEntry>(e => e.PostId == existing.ID);
|
||||
await DB.Default.Update<PostEntity>().MatchID(original.ID).Modify(b => b.Inc(p => p.ReblogsCount, -1)).ExecuteAsync(token);
|
||||
await _delivery.EnqueueToFollowers(me, Undo(me, announce, $"undo-announce-{existing.ID}"), token,
|
||||
await AuthorInbox(original, token) is { } authorInbox ? new[] { authorInbox } : default);
|
||||
await AuthorInbox(original, token, shared: true) is { } authorInbox ? new[] { authorInbox } : default);
|
||||
return new StatusOutcome(original);
|
||||
}
|
||||
|
||||
@@ -595,11 +595,14 @@ namespace PrivaPub.Domain.Statuses
|
||||
return post != default && await VisibilityPolicy.CanSee(post, me.Id, token) ? post : default;
|
||||
}
|
||||
|
||||
async Task<string> AuthorInbox(PostEntity post, CancellationToken token)
|
||||
// shared: what goes to the author's followers too (a boost) goes to its server's shared inbox, so the server gets
|
||||
// one copy, as Mastodon sends it; two copies at once race in servers that count as they process (Misskey)
|
||||
async Task<string> AuthorInbox(PostEntity post, CancellationToken token, bool shared = false)
|
||||
{
|
||||
if (!post.IsFederatedCopy || string.IsNullOrEmpty(post.AuthorAccountId))
|
||||
return default;
|
||||
return (await _dbEntities.ForeignAvatars.MatchID(post.AuthorAccountId).ExecuteFirstAsync(token))?.InboxURL;
|
||||
var author = await _dbEntities.ForeignAvatars.MatchID(post.AuthorAccountId).ExecuteFirstAsync(token);
|
||||
return shared && !string.IsNullOrEmpty(author?.SharedInboxURL) ? author.SharedInboxURL : author?.InboxURL;
|
||||
}
|
||||
|
||||
async Task<bool> MayPost(Models.Group.Group group, LocalActor author, CancellationToken token)
|
||||
|
||||
Reference in new issue
Block a user