← Blog

Dev log: taking the libraries out

Two weeks since the last post, and a lot has changed in hrthd, including taking out the thing that post was mostly about.

Changelog

Libraries come out

  • Libraries, hrth nodes, sealed buckets, members’ own storage and git repositories are gone from the server, the apps, the command line and the docs. A migration drops their tables. Libraries will come back as a new design, not a patch on the old one.
  • The music player, watch parties and listening rooms stay, and now play video and audio attachments. Play, Play next and Add to queue are on the file in chat, and a party’s “+ Add” searches that conversation’s attachments on your device.
  • Inline players have left the chat. A voice note or a video shows as a file with Play, and plays in the player, so only one thing plays at a time.

Attachments are files

  • The server is a delivery queue: it keeps an attachment until every device in the conversation has it, 30 days at most, and never streams it.
  • Your device downloads the whole file before playing it. Thumbnails, dimensions and lengths are made on the sender’s device and travel inside the encrypted message, so showing one fetches nothing.
  • Downloads decrypt a part at a time, resume when cut short, and can be retried or cancelled. Deleting a message takes your kept copy of its file with it.
  • An admin’s storage location (a bigger disk or an S3-compatible bucket) now holds only that queue, and the 30-day limit applies there too: files kept in one were never being deleted, and now they are. Browsers never contact the bucket.
  • Attached files wait in the composer until you press Send.

Devices

  • Linking a new device can bring your message history, and optionally the attachments you keep, encrypted with a key that travels only in the link.
  • Read markers sync between your devices, so reading something on one clears its notifications on the rest.
  • A device removed from another one is told, erases itself and goes back to the start screen. Signing out removes the device from your account.
  • Your recovery code now also restores your spaces’ keys, so an owner alone in a space doesn’t lose it.
  • The app opens from what’s on the device before any server answers. If your server is down it opens read-only and says so; if another server is down, what it hosts stays readable and is marked as unreachable.
  • In a browser, a card explains once that the browser may clear your keys and messages, and suggests the app, or the Home Screen on iPhone and iPad, which keep them.

Moving and meeting people

  • One flow for moving your account to another server, into a new account or one you already have. Your device makes the move code, and your spaces’ keys travel sealed so neither server sees them. History comes along unless you say not to, and your DMs continue on the other side.
  • A move that fails partway, from a server going down or a window closing, is abandoned cleanly and can be tried again.
  • Every first DM starts as a message request, even between people in the same space. Someone you haven’t accepted gets no keys or profile, and can’t tell whether your account exists. Requests lapse after 30 days.
  • Several ways a dishonest server could misuse federation are closed, and your device now remembers the keys of other people’s devices and warns you if one changes or someone poses as you.

Apps and updates

  • Servers update themselves from signed releases, checked every hour, and roll back if a new version doesn’t stay up.
  • The apps update themselves too, from releases signed with a key per system: the Linux AppImage and .deb, the Android APK, and the Windows installer.
  • The desktop app moved from Tauri to Electron, so calls work on Linux. The Linux app brings your data over from the old one on first launch.
  • A macOS app for Apple silicon, not notarized yet. Everything is on the Download page.
  • An unread count on the tray icon and on the Windows taskbar. Links open in your browser rather than inside the app.

Calls and chat

  • Voice at 96 kbps, a call bar of icons, and a speaker or earpiece switch in the Android app.
  • A call in progress shows in the sidebar under its channel or DM, with who’s in it, and you join from there. One call per account at a time.
  • Threads take the whole conversation at every width, and an invite link in a message becomes a card to join from.
  • The app asks once, after a device’s first sign-in, whether to turn on notifications, and the connection comes back at once after a phone drops it silently.

Dev Notes

Last time we wrote that storage is always someone’s: your own bucket, or a folder on a computer at home, with the server as a switchboard. Next was going to be sharing a bucket with friends. Working that out, the design kept growing: keys for each file, grants for each audience, gates in front of every bucket. Each piece made sense, and together they were more than we could keep honest while also building chat, calls and accounts. So we took libraries out entirely, nodes and buckets with them, and kept everything else working. They’ll come back as a new design on a clean tree.

What stays is the part of the old idea we’re surest of. The server is a delivery queue, not a store. Messages and attachments live on people’s devices, and the server holds them only until every device has them. It doesn’t stream files any more, because a server that streams has to keep them. A lot of this fortnight was making that hold up when things go wrong: devices that open without a server, history that travels when you link a new one, recovery that brings back your spaces, and moves between servers that either finish or leave both sides as they were.

The other half was getting hrth onto people’s machines and keeping it current. Servers and apps now update themselves from signed releases, on Linux, Android, Windows and macOS. Linux pushed the desktop app to Electron: its system web view couldn’t do encrypted calls, and calls aren’t optional. Underneath it is still the same web client and the same Rust core, so every platform speaks the same protocol.

We’ve also changed how we work. The docs were rewritten to describe the system as it is, with no notes about what used to be there, and there’s now a single list of what has to be done before launch.

What’s next

Most of the launch list is the work that makes a group server safe to run: reporting people and spaces, bans and an audit log, blocking, a copyright process, and deleting your account from Settings. Then the iPhone app through TestFlight, a notarized Mac app, and checking the Windows and Mac builds on real machines. The web client is also getting a new look, plainer and closer to a terminal, which is being drafted now. And libraries, redesigned.