Show federated user profiles on local instance instead of redirecting externally #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a federated entry appears in the activity feed, clicking the username currently opens the remote actor's profile on their home instance (external redirect). Instead, the local instance should render a federated profile page at
/users/{user_id}using data already stored locally.Current behaviour
is_federated: truelink to the remote actor URL (e.g.https://movies.gabrielkaszewski.dev/users/…) in a new tab/api/v1/users/{user_id}has no record for the synthetic user IDExpected behaviour
/users/{user_id}works for both local and federated users. For federated users, the backend detects that the ID is synthetic, resolves the actor URL from stored reviews, looks upap_remote_actors, and returns a profile response. The SPA shows their handle, display name, bio, avatar, and their locally-stored federated reviews — all without leaving the instance.Data already available locally
ap_remote_actorshandle,display_name,bio,avatar_url,banner_url,outbox_urlreviews WHERE remote_actor_url IS NOT NULLThe synthetic
user_idisUUIDv5(actor_url)so the actor URL can be looked up viaSELECT remote_actor_url FROM reviews WHERE user_id = ? AND remote_actor_url IS NOT NULL LIMIT 1.Implementation sketch
Backend:
GET /api/v1/users/{user_id}: if no local user found, query reviews to findremote_actor_url, then look upap_remote_actorsusers/get_federated_profile+ new port method on the federation query sideSPA:
/users/{user_id}already navigates correctly — no route changes neededactor_urlonReviewCardbecomes a fallback only for actors not yet cached inap_remote_actorsRelated
ap_remote_actorstable populated during Follow/Accept flow and actor fetchreviews.remote_actor_urlcolumn links reviews to their remote authorreview_handler.rson_create