Urgent.News

What's breaking now, across hundreds of outlets.

Culture

Rotating bios in Matrix

Matrix allows users to have profile bios, with the details stored as key-value pairs. The "bio" field was added to the User Profile API specification (MSC4133) in August 2025. However, the bio is static, meaning it can only contain one value at a time and changing it requires updating the profile on the server. To address this issue, the author implemented a system to randomly display a biography from a list, which was initially done by intercepting requests to the endpoint that fetches a user's profile and returning a random biography.

However, this approach became impractical due to the need to edit and compile the server's code whenever a new biography was added or the existing ones were changed. The author then discovered that the user's profile data is stored as a key-value store in JSON format, similar to other profile fields. They decided to move the logic for selecting a random biography from the server's build call to the user service, allowing for client-to-server requests to also receive a randomised biography.

This solution enabled the author to edit their biographies in a user-friendly manner, while also addressing the issue of profile data size limitations. To further optimize the system, the author moved the list of biographies to the user's account data, which is only visible to the authenticated user and not to others requesting the profile.

This way, the author's biographies are stored separately and do not consume space in the main profile repository, preventing conflicts with other profile fields.

Rewritten by urgent.news; may contain errors — check the original.

Source: nexy.blog

Read the original at nexy.blog →

Report a problem with this story

More in Culture

More from Saturday, 28 November 2026 →