A remote delete clears what it touched
Deleting a remote post now removes its timeline entries and the reblogs of it and lowers its parent's reply count; deleting a remote actor also drops the follows pointing at it and its entries in home timelines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
b34c71775c
commit
afd2e727d0
2 files changed
+32
-3
No files matched your search
@@ -122,6 +122,26 @@ namespace PrivaPub.Tests.Domain
|
||||
Assert.DoesNotContain("<p>parent</p>", (await Home(bobRoot, bob.Id)).Select(p => p.ContentHtml));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task A_remote_delete_takes_the_post_out_of_home()
|
||||
{
|
||||
var (bobRoot, bob) = await _harness.Persona("bob");
|
||||
var carol = new RemoteActor(_harness.Peer, "carol");
|
||||
await Accepted(bobRoot, bob.Id, carol);
|
||||
var create = Create(carol, text: "soon gone");
|
||||
await _harness.Deliver(carol, "/human-centipede", create);
|
||||
Assert.Single(await Home(bobRoot, bob.Id));
|
||||
|
||||
await _harness.Deliver(carol, "/human-centipede", new JsonObject
|
||||
{
|
||||
["id"] = $"{new Uri(carol.Id).GetLeftPart(UriPartial.Authority)}/deletes/{Guid.NewGuid():N}", ["type"] = "Delete", ["actor"] = carol.Id,
|
||||
["object"] = new JsonObject { ["id"] = create["object"]!["id"]!.GetValue<string>(), ["type"] = "Tombstone" }
|
||||
});
|
||||
|
||||
Assert.Empty(await Home(bobRoot, bob.Id));
|
||||
Assert.False(await DB.Default.Find<TimelineEntry>().Match(e => e.AvatarId == bob.Id).ExecuteAnyAsync(TestContext.Current.CancellationToken));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task A_mention_notifies_the_persona()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user