fix(federation): carry error body on HttpError so Reset-cleanup owns-spaces copy reaches the UI

Also narrow SanitizedPeer.needsAttentionReason to the shared union.
This commit is contained in:
Jannis Braun
2026-07-02 02:19:13 +02:00
parent 493deefc64
commit 43d1dad1d7
4 changed files with 33 additions and 21 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ interface SanitizedPeer {
rotationInProgress: boolean;
secretRotatedAt: number | null;
autoRotateIntervalDays: number;
needsAttentionReason: string | null;
needsAttentionReason: 'auth_failures' | 'peer_reset_detected' | null;
}
function sanitizePeer(row: typeof schema.federationPeers.$inferSelect): SanitizedPeer {
@@ -57,7 +57,7 @@ function sanitizePeer(row: typeof schema.federationPeers.$inferSelect): Sanitize
rotationInProgress: row.pendingHmacSecret !== null,
secretRotatedAt: row.secretRotatedAt,
autoRotateIntervalDays: row.autoRotateIntervalDays,
needsAttentionReason: row.needsAttentionReason,
needsAttentionReason: row.needsAttentionReason as SanitizedPeer['needsAttentionReason'],
};
}