Table: federation_outbox
A per-recipient queue of outbound deliveries, filled from the activities ledger by the outbox dispatcher. Two partial unique indexes, on (activity_id, peer_id) for broadcast rows and on (activity_id, peer_id, target_user_url) for targeted rows, let the dispatcher re-run without adding duplicates. When delivery refuses an activity, its row is marked refused with a refused_reason. The policy that refuses restricted and embargoed content without encryption exists, but the running configuration doesn’t yet give the dispatcher the sensitivity it needs, so that refusal isn’t in effect (#1525).
Connected to
Section titled “Connected to”This table references:
activities(id) via columnactivity_idfederation_peers(id) via columnpeer_id
Columns
Section titled “Columns”| Column | Type | Nullable | Notes |
|---|---|---|---|
id | uuid | no | Default gen_random_uuid() |
activity_id | uuid | no | References activities(id) |
peer_id | uuid | no | References federation_peers(id) |
target_user_url | text | yes | - |
status | text | no | Default 'queued'::text |
attempts | smallint | no | Default 0 |
next_attempt_at | timestamp | no | Default now() |
last_attempt_at | timestamp | yes | - |
last_error | text | no | Default ''::text |
sent_at | timestamp | yes | - |
delivered_with_key_id | text | yes | - |
created_at | timestamp | no | Default now() |
updated_at | timestamp | no | Default now() |
was_encrypted | boolean | no | Default false. True when delivery took the encryption path (the peer had negotiated encryption support and the recipient’s key was available); false for plaintext. The envelope sent is authoritative; this column records the outcome for monitoring. |
sensitivity | text | yes | - |
refused_reason | text | yes | - |
Constraints
Section titled “Constraints”CONSTRAINT federation_outbox_status_check CHECK ((status = ANY (ARRAY['queued'::text, 'sent'::text, 'failed'::text, 'cancelled'::text, 'refused'::text])))
Full DDL
Section titled “Full DDL”This is the table’s CREATE TABLE statement. Constraints added with separate ALTER TABLE statements, including foreign-key ON DELETE rules, and indexes are defined elsewhere in the dump; see the complete app/schema.sql.
CREATE TABLE public.federation_outbox ( id uuid DEFAULT gen_random_uuid() NOT NULL, activity_id uuid NOT NULL, peer_id uuid NOT NULL, target_user_url text, status text DEFAULT 'queued'::text NOT NULL, attempts smallint DEFAULT 0 NOT NULL, next_attempt_at timestamp with time zone DEFAULT now() NOT NULL, last_attempt_at timestamp with time zone, last_error text DEFAULT ''::text NOT NULL, sent_at timestamp with time zone, delivered_with_key_id text, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, was_encrypted boolean DEFAULT false NOT NULL, sensitivity text, refused_reason text, CONSTRAINT federation_outbox_status_check CHECK ((status = ANY (ARRAY['queued'::text, 'sent'::text, 'failed'::text, 'cancelled'::text, 'refused'::text]))));See the schema overview for context.