fix(federation): set correct homeInstance in relay payload and fix canonical backfill SQL
- buildRelayPayload now uses config.domain for local users instead of empty string, so the relay receiver can resolve the user - Fixed canonical_pair_id backfill: SQLite NULL || ':' || x = NULL, so use COALESCE(home_user_id, id) instead of concatenation
This commit is contained in:
@@ -4,6 +4,7 @@ import { eq, and } from 'drizzle-orm';
|
||||
import { generateSnowflake } from './snowflake.js';
|
||||
import crypto from 'node:crypto';
|
||||
import type { FederationRelayEvent } from '@backspace/shared';
|
||||
import { config } from '../config.js';
|
||||
|
||||
// ─── Settings Cache ──────────────────────────────────────────────────────────
|
||||
|
||||
@@ -230,7 +231,7 @@ export function buildRelayPayload(
|
||||
return {
|
||||
userId: user.id,
|
||||
homeUserId: user.homeUserId || user.id,
|
||||
homeInstance: user.homeInstance || '',
|
||||
homeInstance: user.homeInstance || config.domain || '',
|
||||
content: message.content,
|
||||
replyToId: message.replyToId ?? null,
|
||||
editedAt: message.editedAt ?? null,
|
||||
|
||||
Reference in New Issue
Block a user