Skip to content

Federation: accordkit SDK support for qualified IDs, origin, and the join trigger #168

Description

@krazyjakee

Client-side follow-up to server federation (accordserver#38).

The Accord server now speaks peer-to-peer federation, but the vendored SDK (packages/accordkit) has no federation support: no origin field on any model, no qualified-ID (<snowflake>@<domain>) handling, and no endpoint to join a remote-homed space. Nothing in the client can currently consume a federated space.

This issue covers the protocol/SDK plumbing that the Flutter UI work depends on.

Task

  • origin field: add the optional origin (home domain) field that the server now returns on users, spaces, channels, roles, messages, and members. Parse and round-trip it on the relevant Accord* models.
  • Qualified IDs: tolerate IDs that cross the wire qualified as <snowflake>@<domain> without breaking lenient snowflake/timestamp parsing (server strips @domain for timestamps — mirror that). Remote authors also carry fully-qualified handles.
  • Join trigger: expose the authed POST /api/v1/federation/spaces/join call (initiates the join handshake and applies the returned snapshot).
  • Remote DMs: surface cross-server DM open against a remote recipient (qualified user id).
  • Remote media: ensure emoji/attachment URLs that arrive as absolute home-server CDN URLs are used as-is (not re-pointed at the local CDN).

Pointers

  • packages/accordkit/lib/src/models/ (add origin)
  • packages/accordkit/lib/src/rest/ (federation join endpoint)
  • Snowflake/timestamp parsing in accordkit (qualified-ID tolerance)
  • Server reference: src/routes/spaces.rs (join_federated_space), src/federation/mapping.rs (qualified-ID helpers), src/federation/handshake.rs (snapshot shape)

Acceptance

  • Accord* models expose origin and survive a round-trip where IDs are qualified.
  • A client can call the federated-space join endpoint and hydrate the returned snapshot (space, channels, roles, members, recent messages).
  • Snowflake-derived timestamps still parse for qualified IDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfederationCross-server (peer-to-peer) federation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions