Skip to content

Reject null profile field values (following an optional clause in the specification), in order to avoid clients accidentally harming interoperability. - #20153

Draft
reivilibre wants to merge 5 commits into
developfrom
rei/rej_profile_null
Draft

Reject null profile field values (following an optional clause in the specification), in order to avoid clients accidentally harming interoperability.#20153
reivilibre wants to merge 5 commits into
developfrom
rei/rej_profile_null

Conversation

@reivilibre

@reivilibre reivilibre commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Depends on: matrix-org/complement#914

displayname and avatar_url already did not permit nulls, seemingly from #8223.

The specification at v1.15 does not permit null for those fields either, so this seems consistent with historical specification.

This only changes behaviour for 'custom' fields.

  1. Add test

    This passes for displayname and avatar_url

    This fails for the custom field

  2. Reject profile fields with NULL

  3. cosmetic drive-by: Use BAD_REQUEST in neighbours

@reivilibre
reivilibre force-pushed the rei/rej_profile_null branch from e2211f2 to 1a8d4f9 Compare August 26, 2026 16:13
reivilibre added a commit to reivilibre/fork-element-web that referenced this pull request Aug 26, 2026
Null is not interoperable as an allowable field value:

> Servers MAY reject null values.
— https://spec.matrix.org/v1.19/client-server-api/#put_matrixclientv3profileuseridkeyname

Synapse will enforce this to help in element-hq/synapse#20153
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.

1 participant