A follow of a persona's profile page; an Update under its Create's id

Forte follows a persona by its profile page (/@name, WebFinger's alias) rather than its actor's id: Follow and
Undo{Follow} now find the persona by either (it was a 404). Forte also sends an edit only added to the thread's context
(FEP-171b), under the same activity id as the post's Create: the unwrapping now tells two activities that share an id
apart by what they carry, as the inbox does, so the Update is not taken for a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-06 10:58:45 +02:00
1 parent d06f684f0d
commit 99b5e2dbf3
6 files changed
+67 -8

No files matched your search

+4 -3
View File
@@ -225,7 +225,7 @@ namespace PrivaPub.Federation.Inbox
static string HostOf(string uri) => Uri.TryCreate(uri, UriKind.Absolute, out var parsed) ? parsed.Host.ToLowerInvariant() : default;
static bool CarriesOther(string earlierPayload, JsonNode activity)
public static bool CarriesOther(string earlierPayload, JsonNode activity)
{
if (earlierPayload == default)
return false;
@@ -235,7 +235,7 @@ namespace PrivaPub.Federation.Inbox
}
// what an activity carries, short: its type, actor and object
static string Digest(JsonNode activity) =>
public static string Digest(JsonNode activity) =>
Convert.ToHexString(System.Security.Cryptography.SHA256.HashData(System.Text.Encoding.UTF8.GetBytes(
$"{Value(activity, "type")}\n{Id(activity["actor"])}\n{activity["object"]?.ToJsonString()}")))[..16].ToLowerInvariant();
@@ -252,7 +252,8 @@ namespace PrivaPub.Federation.Inbox
switch (type)
{
case "Follow":
var target = await _localActors.FindByUri(Id(inner), token);
// (by its actor's id, or the profile page Forte names instead)
var target = await _localActors.FindByAddress(Id(inner), token);
if (target is not { IsFederated: true } || target.Kind == LocalActorKind.Application)
return new(StatusCodes.Status404NotFound, "no such local actor", Reason: "unknown-recipient");
break;