Skip to content

Conversation

@Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Jan 31, 2025

We seem to have updated this for m.room.name some years back but omitted it for topic.

Signed-off-by: Half-Shot [email protected]

Pull Request Checklist

Preview: https://pr2068--matrix-spec-previews.netlify.app

…vent.

We seem to have [updated this for m.room.name](matrix-org#1639) some years back but omitted it for topic.
@Half-Shot Half-Shot requested a review from a team as a code owner January 31, 2025 11:21
@Half-Shot Half-Shot changed the title Describe behaviour when the topic key is falsey in a m.room.topic e… Describe behaviour when the topic key is falsey in a m.room.topic event. Jan 31, 2025
@Half-Shot Half-Shot changed the title Describe behaviour when the topic key is falsey in a m.room.topic event. Describe behaviour when the topic key is falsey in a m.room.topic event. Jan 31, 2025
The room topic can also be set when creating a room using `/createRoom` with the `topic` key.'
If a room has an `m.room.topic` event with an absent, null, or empty `topic`
field, it should be treated the same as a room with no `m.room.topic` event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's a great clarification in itself, it would be even greater to further clarify what happens when an event with an absent/null/empty topic comes upon a previous event with non-falsey topic. I guess the room topic should be reset to the as-if-no-topic state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I suppose I thought that was the implication as with the m.room.name description => clients should use the latest state to render the room, and this description tells clients to assume the topic isn't set.

I'm struggling to find words that doesn't sound a bit repetitive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In other words, an empty topic property effectively resets the room to having no topic."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, https://github.com/matrix-org/matrix-spec/blob/main/meta/documentation_style.rst#general:

prefer the word "property" to "field", "member", or various other alternatives

Suggested change
field, it should be treated the same as a room with no `m.room.topic` event.
property, it should be treated the same as a room with no `m.room.topic` event.
In other words, sending an `m.room.topic` event with an empty `topic` effectively
resets the room to having no topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better?

The room topic can also be set when creating a room using `/createRoom` with the `topic` key.'
If a room has an `m.room.topic` event with an absent, null, or empty `topic`
field, it should be treated the same as a room with no `m.room.topic` event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In other words, an empty topic property effectively resets the room to having no topic."

The room topic can also be set when creating a room using `/createRoom` with the `topic` key.'
If a room has an `m.room.topic` event with an absent, null, or empty `topic`
field, it should be treated the same as a room with no `m.room.topic` event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, https://github.com/matrix-org/matrix-spec/blob/main/meta/documentation_style.rst#general:

prefer the word "property" to "field", "member", or various other alternatives

Suggested change
field, it should be treated the same as a room with no `m.room.topic` event.
property, it should be treated the same as a room with no `m.room.topic` event.
In other words, sending an `m.room.topic` event with an empty `topic` effectively
resets the room to having no topic.

@Half-Shot Half-Shot requested a review from richvdh April 15, 2025 13:54
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@richvdh richvdh merged commit 65b1db7 into matrix-org:main Apr 15, 2025
12 checks passed
Johennes pushed a commit to Johennes/matrix-spec that referenced this pull request May 30, 2025
… event. (matrix-org#2068)

We seem to have [updated this for m.room.name](matrix-org#1639) some years back but omitted it for topic.
@Johennes Johennes mentioned this pull request Jul 3, 2025
34 tasks
Comment on lines +10 to +11
If the `topic` property is absent, null, or empty then the topic is unset. In other words,
an empty `topic` property effectively resets the room to having no topic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly confused about the absent / null part of this. topic is labeled as required. So I think it could at most be an empty string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could have been redacted. Or received over federation from a server that doesn't enforce the presence of the "required" properties.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. I hadn't thought about redactions.

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.

4 participants