feat(social): federated branch for POST /api/social/requests (happy path)

Refactors the POST handler into handleLocalFriendRequest + handleFederatedFriendRequest helpers. The federated branch resolves the target domain, ensures peering, looks up the remote user, creates/hydrates a replicated stub, and writes a transactional (friend_requests + mutation_log + outbox) event with relayMessageId set. Also exports hydrateReplicatedUserProfile from federation.ts and adds the T11 happy-path test.
This commit is contained in:
Jannis Braun
2026-04-25 22:04:36 +02:00
parent 08872f1e08
commit 0574a10ff3
4 changed files with 465 additions and 113 deletions
+1 -1
View File
@@ -3845,7 +3845,7 @@ function processOwnershipTransferEvent(
* Only updates fields that are currently null/empty on the local row,
* so manually-set local values are preserved.
*/
function hydrateReplicatedUserProfile(
export function hydrateReplicatedUserProfile(
user: typeof schema.users.$inferSelect,
profile: FederationRelayProfileSnapshot | undefined,
db: ReturnType<typeof getDb>,