Skip to content

Implement initial MSC4440 Bios with extensible events formatting#559

Merged
dozro merged 2 commits intoSableClient:devfrom
dozro:compat/MSC4440
Mar 27, 2026
Merged

Implement initial MSC4440 Bios with extensible events formatting#559
dozro merged 2 commits intoSableClient:devfrom
dozro:compat/MSC4440

Conversation

@dozro
Copy link
Copy Markdown
Contributor

@dozro dozro commented Mar 27, 2026

Description

This pull request adds support for saving and reading user bios in the MSC4440 format, improving compatibility with the MSC4440 specification for Matrix user profiles. The changes ensure that bios are now stored and retrieved in both the legacy and MSC4440-compliant formats, and introduce new types to support this functionality.

MSC4440 Bio Compatibility

  • User bios are now saved in the MSC4440 format (gay.fomx.biography) in addition to existing formats, ensuring forward compatibility with the MSC4440 spec. When saving, both HTML and plain text representations are stored.
  • The user profile normalization logic now reads bios from the MSC4440 field first, falling back to legacy fields if necessary.
  • The fields handled by the normalization function are updated to include the MSC4440 bio key.

Type and Import Updates

  • New types MSC1767Text and MSC4440Bio are introduced to represent the MSC4440 bio format, and relevant imports are updated throughout the codebase.

implements matrix-org/matrix-spec-proposals#4440

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

No AI was used in the creation of this PR

@dozro dozro requested review from 7w1 and hazre as code owners March 27, 2026 16:05
@dozro dozro marked this pull request as draft March 27, 2026 16:30
@dozro dozro marked this pull request as ready for review March 27, 2026 16:39
@dozro dozro added this pull request to the merge queue Mar 27, 2026
Merged via the queue into SableClient:dev with commit dae136e Mar 27, 2026
9 checks passed
@dozro dozro mentioned this pull request Mar 28, 2026
10 tasks
@dozro dozro deleted the compat/MSC4440 branch March 28, 2026 11:53
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2026
### Description

Fixes profile and avatar loading regressions introduced around the
MSC4440 bio compatibility work.

This PR addresses two related problems:

- Own profile data could disappear when `useUserProfile` encountered
`gay.fomx.biography` in an unexpected shape or when the field was
missing entirely.
- Avatar components could get stuck in fallback mode after a transient
image load failure, causing the account avatar and other avatars to
disappear until a full reload.

The fix does three things:

- parses `gay.fomx.biography` defensively with optional access instead
of assuming `m.text[0].body` always exists
- retries profile fetches when the cache was previously poisoned into an
`_fetched`-only state after normalization failed
- resets avatar error state when the image `src` changes so transient
media/auth failures can recover on later renders

This was verified against the broken Account settings / account switcher
behavior where avatar, banner, bio, status, and pronouns could appear
missing.

Fixup of #559

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [x] Partially AI assisted (GitHub Copilot)

`useUserProfile.ts`: Hardened MSC4440 bio parsing so missing or
malformed `gay.fomx.biography` data does not throw during normalization,
and allowed refetching when the profile cache only contains `_fetched:
true` from a prior failed normalization.

`UserAvatar.tsx` and `RoomAvatar.tsx`: Reset local image error state
when `src` changes so a temporary image load failure does not
permanently lock the component into fallback rendering.
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2026
> [!IMPORTANT]
> Merging this PR will create a new release.

## Features

* Add ability to click on usernames in member and state events to view
user info ([#536](#536) by
@thundertheidiot)
* Add black theme ([#437](#437)
by @Elec3137)
* added a limited compatibility with `pk;member` commands
([#550](#550) by @dozro)
* Add /location sharing command, and a /sharemylocation command.
([#509](#509) by @nushea)
* added option to use shorthands to send a message with a Persona, for
example `✨:test` ([#550](#550)
by @dozro)
* Add quick reply keybinds by using <kbd>ctrl</kbd>+<kbd>up</kbd> /
<kbd>ctrl</kbd>+<kbd>down</kbd> you can now cycle through the message
you are replying to with keybinds
([#524](#524) by @CodeF53)
* Adds a `/html` command to send HTML messages
([#560](#560) by @Vespe-r)
* Add room abbreviations with hover tooltips: moderators define
term/definition pairs in room settings; matching terms are highlighted
in messages. ([#514](#514) by
@Just-Insane)
* Add support for timestamps, playlists and youtube music links for the
youtube embeds ([#534](#534) by
@thundertheidiot)
* Add settings sync across devices via Matrix account data, with JSON
export/import ([#515](#515) by
@Just-Insane)

## Fixes

* Add detailed error messages to forwarding failures.
([#532](#532) by @7w1)
* Cap unread badge numbers at `1k+`, and something extra :)
([#484](#484) by @hazre)
* Fix scroll-to-bottom after room navigation, timeline pagination
reliability, and URL preview deduplication.
([#529](#529) by @Just-Insane)
* Fixes the most recent pmp message in encrypted rooms not consistently
rendering the pmp and not grouping with previous pmps.
([#526](#526) by @7w1)
* fixed sending sticker and attachments while having a persona selected
([#525](#525) by @dozro)
* Fix push notifications missing sender/room avatar and showing stale
display names when using event_id_only push format.
([#551](#551) by @Just-Insane)
* Sanitize formatted reply previews before rendering to prevent unsafe
HTML from being parsed in reply snippets.
([#569](#569) by @Just-Insane)
* Fix broken link to Sliding Sync known issues — now points to
#39 instead of the old repository.
([#519](#519) by @Just-Insane)
* Fix service worker authenticated media requests returning 401 errors
after SW restart or when session data is missing/stale.
([#516](#516) by @Just-Insane)
* rephrased the command describtion for `/usepmp` and made `/usepmp
reset` actually reset the room association of the pmp
([#550](#550) by @dozro)
* Fix confusing ui with `Client Side Embeds in Encrypted Rooms` setting
([#535](#535) by
@thundertheidiot)
* fix forwarding metadata by removing the `null` value
([#540](#540) by @dozro)
* fix forwarding issue for users on synapse homeservers, by removing the
relation ([#558](#558) by
@dozro)
* fixed the syntax issues regarding `/addpmp` and `usepmp` (note that
the syntax for `/usepmp` has changed)
([#550](#550) by @dozro)
* fix the display of jumbo emojis on messages sent with a persona
([#530](#530) by @dozro)
* Fix sidebar notification badge positioning so unread and unverified
counts align consistently.
([#484](#484) by @hazre)
* Use the browser's native compact number formatting for room and member
counts. ([#484](#484) by
@hazre)
* fix(sentry): scrub percent-encoded Matrix IDs and opaque base64url
tokens from Sentry URLs
([#531](#531) by @Just-Insane)

## Notes

* new/changed bios will now also be saved in the format MSC4440 expects
([#559](#559) by @dozro)
* moved the setting for filtering pronouns by language from experimental
to the appearance setting
([#521](#521) by @dozro)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants