YACS

Conversations

Starting a conversation

YACS never asks for a phone number or your address book. There are several ways to connect:

  1. Invite link / QR code. A new conversation has an invitation code. Share the link (https://your-host/~/<code>) or let the other person scan the QR code. When they open it, the invitation is accepted and you're connected.
  2. Username. Users with a public profile can be added by username.
  3. Nearby. Start a chat with someone you found through Nearby discovery.

When two people connect, an info message ("New connection") opens the conversation, and the other person is notified in real time — or by push if they are offline and have opted in.

Direct and group conversations

  • Direct conversations are between two users.
  • Groups have a name (up to 100 characters) and any number of members. Members can be added and removed, and messages from others show the sender's name.

Messages

Messages have a type:

TypeMeaning
messagePlain text, with links detected automatically
imageUploaded image with a generated thumbnail
fileA file offered for peer-to-peer transfer
callA call record (answered, missed, declined…)
infoSystem notice, e.g. "New connection"

Messages can reply to another message (a snapshot of up to 500 characters of the quoted text is kept), be edited, and be deleted. Typing indicators and read receipts are sent over the realtime channel.

Each message carries a delivery status:

SENDING → SENT → DELIVERED → SEEN

File transfers and calls use additional states: ACCEPTED, REJECTED, CANCELLED, PROGRESS, COMPLETED, DECLINED, MISSED.

How direct messages are delivered

Direct-conversation traffic is wrapped in an envelope (yacs.v1.Envelope), which carries either a new message, a status change, or a deletion.

  1. The sender's device tries to deliver the envelope over an open WebRTC peer connection to each of the recipient's devices.
  2. It then asks the server to relay it (EnvelopeSend), listing the device IDs that already received it peer to peer.
  3. The server forwards the envelope live to the remaining devices that are online. It queues the envelope only for devices that couldn't receive it.
  4. When a device reconnects it syncs its queue and acknowledges envelopes it has stored, which removes them from the server.

Envelopes are limited to 64 KB. Messages are stored client-side in IndexedDB, and an offline outbox keeps messages you write without a connection and sends them once you're back online.

Where messages are stored

Direct conversations: on your devices, not on the server.

  • Each device keeps its message history in local browser storage (IndexedDB).
  • Messages go device to device over WebRTC when a peer connection is open.
  • The server stores a message only if a recipient device hasn't received it yet. If every device got it peer to peer or through the live relay, nothing is written. Otherwise the envelope waits in a pending queue for just the devices that missed it.
  • A queued envelope is deleted as soon as that device has received and stored it. Removing the device or deleting the conversation also clears its queue. Deletion depends on delivery, not on whether the message has been read.
  • Messages from older versions that are still on the server are pulled down to every device once and then deleted from the server.

As a result, the server doesn't keep a copy of your direct-message history. Clearing a device's site data removes that device's copy of the history.

What the server does store

DataWhy
Group conversation messagesGroups are delivered through the server and stored in MongoDB.
Call records and system notices (e.g. "New connection")Needed for ringing, call history and invitations.
Uploaded imagesStored under MEDIA_URL when an image can't be sent peer to peer, and always for groups.
Pending envelopes (direct chats)Only for recipient devices that haven't received a message yet, deleted on delivery.
Accounts, profiles, devices, conversation membershipNeeded to connect people and route messages.

Files sent with peer-to-peer file sharing are never uploaded.

Sharing into YACS

The installed PWA registers as a share target, so on supported platforms you can share text, links or images from other apps straight into a conversation.