News News feed (Atom)

This Week in Ruma

› published on by

This week serde 0.8.0 was released, offering a new serialization API. Most of the work on Ruma was towards serialization of the ID and event types. This will support the next step of implementing APIs in the homeserver that take events as user input. In addition to the changes landed in ruma-events, I've been working on figuring out how to approach Matrix types that are represented as enums in Rust code but involve checking the value of a key in the JSON structure of the serialized form to determine which variant it is. I hope to get this nailed down and committed by next week's update.

Notable changes to ruma-identifiers

  • Implement serialization and deserialization for ID types.
  • Change the new constructor to an implementation of TryFrom and add a separate generate constructor for generating new IDs with random localparts.
  • Begin running the test suite on Travis CI.
  • Publish the crate to crates.io. ruma-identifiers is the first Ruma component to get a crates.io release!

Notable changes to ruma-events

  • Convert the types of struct fields that represent a Matrix ID from String to the relevant type from ruma-identifiers.
  • Manually implement serialization and deserialization for a few enum types where the variant name appears in JSON camel cased. This was initially done by copy/pasting similar code between types, but was replaced with a macro that reduced a lot of duplication (and actually increased the test suite coverage by testing every single variant of each enum.)
  • Begin running the test suite on Travis CI.

This Week in Ruma

› published on by

This was a relatively quiet week in terms of code changes. I'm working on nailing down ruma-identifiers in preparation for using it in ruma-events before I start working on serialization in ruma-events, which is needed for the next step in ruma itself. Serde is about to release 0.8, which has some breaking changes including a revamped API for manually implementing serialization. I started to learn how it works since I'll need to use it as soon as it's released.

Notable changes to ruma-identifiers

  • Add EventId, RoomId, and RoomAliasId.

Matrix at large

  • I discovered that the new spec introduction that includes the grammar for Matrix IDs is missing some important details about event and room IDs. The spec currently defines them as sigil opaque_id ":" server_name but does not define opaque_id at all. Certain limitations are important to note for the purposes of parsing and compatibility, such as allowed character set and minimum and maximum lengths. I think it's also important to disallow characters that would be problematic for display or parsing, such as whitespace, newlines, and colons, which are also used as the delimiter between opaque ID, IP/hostname, and port. There was already a JIRA issue for specifying these types of IDs, SPEC-389, so I added my concerns there.

Rust at large

  • rustup 0.4 was released, which contains the change I made previously for allowing arbitrary toolchains to be installed alongside rustup itself. I'll be using this to improve Ruma's Docker development image.
  • serde-rs/serde#462: A simple doc fix I made to Serde while looking through the 0.8 changes.
  • rust-lang/rfcs#1681: Procedural macros 1.1. Only tangentially related to Ruma, but an important effort that could help in getting Ruma onto stable Rust.

This Week in Ruma

› published on by

Ruma has a new logo! You can see it on the home page, the GitHub organization, and the Twitter account. For a few weeks I've been experimenting with implementing additional parts of the room creation API, and have learned a lot about how I will approach it, but nothing has landed on master yet. Some of my work has resulted in new issues for the spec, detailed below.

Notable changes to ruma-identifiers

  • Following the new version of the spec which provides formal definitions of Matrix IDs, this new crate was added to the Ruma organization on GitHub to isolate the logic for Matrix IDs.

Notable changes to www.ruma.io

  • Add new logo to the home page.

Matrix at large

  • A new stable version of the client-server specification was released: r0.2.0. Notable improvements include an explicit licensing of the spec and a formal definition of Matrix ID grammar. The blog post has links to more.
  • SPEC-429: Create room API: details of handling initial_state. This issue will move important details currently only in the implementation of Synapse into the spec itself.

Rust at large

  • rustup.rs#586: Allow any toolchain to be specified as the default during rustup installation. Once this is released, it will unblock docker-ruma-dev#1, which will allow for the version of nightly Rust used by Ruma to be pinned.

This Week in Ruma

› published on by

Three major milestones happened for Ruma this week!

  1. Support for events, the basic unit of data in Matrix, landed on the master branch. This is very important, because it's the foundation for almost all the core functionality of the homeserver. The initial implementation of events does not support federation, to keep the scope small, and because the details of federation are still not well specified.
  2. Ruma's documentation website was launched, with its first guide, the Introduction to Matrix, which provides a great explanation of Matrix targeted at non-technical users.
  3. Ruma reached the top of the Hacker News front page. Be sure to read the comment thread.

Notable changes to ruma

  • Add support for events.
  • Add partial support for additional parameters to the room creation endpoint: name, topic, preset, and invite.
  • Create some of the necessary events when a room is created: m.room.create, m.room.name, m.room.topic, m.room.history_visibility, m.room.join_rules, and m.room.member.

Notable changes to ruma-events

  • All event types were restructured to include two generic parameters, one for the primary "content" payload, and one for optional "extra content." This was done to support certain events in the specification that have non-standard key-value pairs at the top level of the data structure.
  • Remove the EventKind trait.
  • Add support for custom event types.

Notable changes to www.ruma.io

  • Add new documentation site and Introduction to Matrix guide. (Contributed in part by Leah Scampoli.)

New contributors

Matrix at large

  • SYN-720: Validation of event content from user input

    Note that this is a bug filed against Synapse, not the spec itself. This was discovered while working on support for the room creation API endpoint's initial_state parameter. Ruma will do proper validation of state events created through this mechanism.

This Week in Ruma

› published on by

There was a lot of work on documentation and code this week, but almost nothing landed on master, so unfortunately there is little to show. An initial draft of the Introduction to Matrix overview document has been pushed to a branch, but a few changes are still planned before it is released. On Ruma itself, a lot of work happened on a branch (currently unpublished) to add support for events to the system. Events are the primary object in the Matrix system, so the addition of this foundational layer will open the gates for all the other major features. The event system is not simple, however, and it's taking some time to figure out a good architecture for data persistence. Because events are involved in both the client-server and federation APIs, and the federation API has not yet had a stable release, it's very difficult to design the system properly. One issue (noted below) has been opened on the Matrix spec requesting clarification that may help to decide on a suitable architecture.

Notable changes to ruma

  • Add PUT /directory/room/:room_alias endpoint. (Contributed by Johannes Oertel.)

Notable changes to ruma-events

  • Use generic types for Event, RoomEvent, and StateEvent.
  • Add unsigned field to RoomEvent and StateEvent.
  • Add EventKind trait. (The event kinds are basic events, room events, and state events. This trait can be useful to constrain a generic parameter that must be a Matrix event.)

Matrix at large

  • SPEC-416: Document all event keys shown in examples