Skip to content

Table: federation_remote_actors

A display cache for remote actors shown in the interface. The Like and comment Create handlers attempt to update it; other accepted activity types currently use stub handlers that don’t refresh this cache. Updates are best-effort, and current senders don’t emit the optional display-name and avatar hints (implementation gap D7). Keyed on actor_uri, which the specification makes globally unique (§8.3).

This table references:

ColumnTypeNullableNotes
actor_uritextno-
peer_iduuidnoReferences federation_peers(id)
display_nametextnoDefault ''::text
avatar_urltextnoDefault ''::text
first_seen_attimestampnoDefault now()
last_seen_attimestampnoDefault now()
updated_attimestampnoDefault now()
encryption_public_keybyteayesThe remote actor’s X25519 public key, as advertised in the aa:encryptionPublicKey block of their envelopes; 32 bytes when present. NULL when the peer hasn’t advertised one.
encryption_public_key_versionintegeryesThe remote actor’s key version, which increases when they rotate their key. Stored as observed.
encryption_public_key_updated_attimestampyesWhen the actor’s advertised key was last successfully written to the cache. Like and comment Create handling can refresh this timestamp when a valid key block is present, even if the key is unchanged. These writes are best-effort; other activity types do not currently refresh it.
  • CONSTRAINT federation_remote_actors_encryption_key_atomic CHECK ((((encryption_public_key IS NULL) AND (encryption_public_key_version IS NULL) AND (encryption_public_key_updated_at IS NULL)) OR ((encryption_public_key IS NOT NULL) AND (octet_length(encryption_public_key) = 32) AND (encryption_public_key_version IS NOT NULL) AND (encryption_public_key_version >= 1) AND (encryption_public_key_updated_at IS NOT NULL))))

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_remote_actors (
actor_uri text NOT NULL,
peer_id uuid NOT NULL,
display_name text DEFAULT ''::text NOT NULL,
avatar_url text DEFAULT ''::text NOT NULL,
first_seen_at timestamp with time zone DEFAULT now() NOT NULL,
last_seen_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
encryption_public_key bytea,
encryption_public_key_version integer,
encryption_public_key_updated_at timestamp with time zone,
CONSTRAINT federation_remote_actors_encryption_key_atomic CHECK ((((encryption_public_key IS NULL) AND (encryption_public_key_version IS NULL) AND (encryption_public_key_updated_at IS NULL)) OR ((encryption_public_key IS NOT NULL) AND (octet_length(encryption_public_key) = 32) AND (encryption_public_key_version IS NOT NULL) AND (encryption_public_key_version >= 1) AND (encryption_public_key_updated_at IS NOT NULL))))
);

See the schema overview for context.