feat(schema): add consecutive_auth_failures column on federation_peers

Tracks HMAC-failure count separately from consecutive_failures (network
errors). Auth failures and network failures have different resolution
paths; mixing them would let a single successful retry after a network
blip mask real secret desync.

Part of backlog #19 — outbox auth-failure recovery.

Note: drizzle-kit generated the 0003 SQL with an unexpected CREATE TABLE
for peer_approval_requests because the 0002 migration was authored
manually without a corresponding 0002_snapshot.json (see 14041e9). The
generated SQL has been trimmed to the single intended ALTER TABLE. The
regenerated 0003_snapshot.json correctly reflects the full current
schema, so future migrations will diff cleanly.
This commit is contained in:
Jannis Braun
2026-04-21 18:40:39 +02:00
parent 85668d4da8
commit 0d3343ab6d
4 changed files with 3234 additions and 0 deletions
+1
View File
@@ -363,6 +363,7 @@ export const federationPeers = sqliteTable('federation_peers', {
lastSeenAt: integer('last_seen_at'),
lastFailureAt: integer('last_failure_at'),
consecutiveFailures: integer('consecutive_failures').default(0),
consecutiveAuthFailures: integer('consecutive_auth_failures').notNull().default(0),
lastSyncedAt: integer('last_synced_at').default(0),
remoteMaxUploadSize: integer('remote_max_upload_size'),
nonceSupported: integer('nonce_supported').notNull().default(0),