Skip to content

Table: federation_inbox

One row per federation activity admitted through ingress validation. Requests rejected before insertion do not create rows here. The inbox handler stores each admitted activity as pending, and a background worker then marks it processed, rejected or failed. The unique activity_uri makes a replayed activity a no-op instead of a second row.

This table references:

ColumnTypeNullableNotes
iduuidnoDefault gen_random_uuid()
activity_uritextno-
peer_iduuidnoReferences federation_peers(id)
actor_uritextno-
activity_typetextno-
object_kindtextyes-
object_iduuidyes-
envelope_jsonjsonbno-
http_sig_keytextno-
received_attimestampnoDefault now()
statustextnoDefault 'pending'::text
reject_reasontextyes-
dispatch_attemptsintegernoDefault 0
last_attempt_attimestampyes-
last_errortextnoDefault ''::text
processed_attimestampyes-
correlation_activity_iduuidyesReferences activities(id)
created_attimestampnoDefault now()
updated_attimestampnoDefault now()
was_encryptedbooleannoDefault false. True when the envelope arrived with an encryption block and took the decryption path; false for plaintext envelopes. The sender-side counterpart is federation_outbox.was_encrypted.
decrypted_with_key_versionintegeryesWhich version of the receiving user’s X25519 key decrypted the envelope. NULL when was_encrypted is false.
  • CONSTRAINT federation_inbox_status_check CHECK ((status = ANY (ARRAY['pending'::text, 'processed'::text, 'rejected'::text, 'failed'::text])))

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_inbox (
id uuid DEFAULT gen_random_uuid() NOT NULL,
activity_uri text NOT NULL,
peer_id uuid NOT NULL,
actor_uri text NOT NULL,
activity_type text NOT NULL,
object_kind text,
object_id uuid,
envelope_json jsonb NOT NULL,
http_sig_key text NOT NULL,
received_at timestamp with time zone DEFAULT now() NOT NULL,
status text DEFAULT 'pending'::text NOT NULL,
reject_reason text,
dispatch_attempts integer DEFAULT 0 NOT NULL,
last_attempt_at timestamp with time zone,
last_error text DEFAULT ''::text NOT NULL,
processed_at timestamp with time zone,
correlation_activity_id uuid,
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,
decrypted_with_key_version integer,
CONSTRAINT federation_inbox_status_check CHECK ((status = ANY (ARRAY['pending'::text, 'processed'::text, 'rejected'::text, 'failed'::text])))
);

See the schema overview for context.