From c9024a4322853f6ec0d3ab098539003d9755c864 Mon Sep 17 00:00:00 2001 From: Flomp Date: Mon, 11 May 2026 20:02:37 +0200 Subject: [PATCH] Fix trails being unavailable when profile is private (#986) --- db/federation/actor.go | 3 ++- db/routes/remote_trail.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db/federation/actor.go b/db/federation/actor.go index c8ba11f2..3199b408 100644 --- a/db/federation/actor.go +++ b/db/federation/actor.go @@ -198,7 +198,8 @@ func assembleActor(app core.App, ctx context.Context, dbActor *core.Record, incl result := make(map[string]interface{}) json.Unmarshal([]byte(privacy), &result) - private = result["account"] == "private" + // check that it's not our own profile + private = result["account"] == "private" && dbActor.Id != strings.TrimPrefix(ctx.Value("actor").(string), "actor:") } else { diff --git a/db/routes/remote_trail.go b/db/routes/remote_trail.go index 739e7cbc..c98dc496 100644 --- a/db/routes/remote_trail.go +++ b/db/routes/remote_trail.go @@ -45,6 +45,9 @@ func RemoteTrailGet(e *core.RequestEvent) error { // Construct the IRI first to see if we already know this trail. record, err = findLocalTrailByRemoteInfo(e, ctx, handle, trailID) if err != nil { + if errors.Is(err, federation.ErrProfilePrivate) { + return e.NotFoundError("profile is private", err) + } return e.InternalServerError("Failed to resolve trail", err) }