Compare commits

...

8 commits

Author SHA1 Message Date
Kierre Sametti 5b45784eee
Merge 6264b34caf into a6da9443da 2026-02-07 12:19:18 -05:00
famfo a6da9443da
s2s/keys: clarify minimum_valid_until_ts query (#2191)
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
Spec / Create release (push) Has been cancelled
2026-02-04 18:30:15 +00:00
Kierre 6264b34caf
clarify exponential notation and add canonical JSON note 2026-01-28 12:05:35 -05:00
Kierre 917f1dd8c1
"visually" -> "technically"
this makes more sense to me
2026-01-28 11:37:58 -05:00
Kierre Sametti 909395ab3c
Update content/rooms/fragments/v1-floaty-power-levels.md
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2026-01-28 11:03:16 -05:00
Kierre Sametti b6198973e0
Update changelogs/room_versions/newsfragments/2297.clarification
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2026-01-28 11:02:53 -05:00
Kierre b09d59bd37
newsfragment 2026-01-25 11:37:36 -05:00
Kierre 68d92cf254
m.room.power_levels events accept values as floats 2026-01-25 11:31:32 -05:00
9 changed files with 59 additions and 8 deletions

View file

@ -0,0 +1 @@
Clarify meaning of floating-point powerlevels.

View file

@ -0,0 +1 @@
Clarify what the `minimum_valid_until_ts` field means when it is set in key queries.

View file

@ -0,0 +1,40 @@
##### `m.room.power_levels` events accept values as floats
When the value is a float, anything after the decimal point is removed,
making e.g. `5.17`, `5.42`, and `5` functionally identical.
For example, this is a valid `m.room.power_levels` event in this room version:
```json
{
"content": {
"ban": 50,
"events": {
"m.room.power_levels": 100
},
"events_default": 0,
"state_default": 50,
"users": {
"@example:example.org": 100,
"@alice:localhost": 50,
"@bob:localhost": 50.57
},
"users_default": 0
},
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "",
"type": "m.room.power_levels"
}
```
In this example, both `@bob:localhost` and `@alice:localhost` have the same effective
power level of `50`, even though the values are technically different.
When a float written in exponential notation is unpacked, the decimal portion is removed
afterward; for example, `5.114698E4` becomes `51146.98`, which is then truncated to `51146`.
Note that, since this room version does not enforce that events comply with the requirements
of [Canonical JSON](/appendices#canonical-json), power levels can be formatted as floats.

View file

@ -59,6 +59,8 @@ Events in version 1 rooms have the following structure:
{{% rver-fragment name="v1-stringy-power-levels" %}}
{{% rver-fragment name="v1-floaty-power-levels" %}}
### Authorization rules
{{% rver-fragment name="v1-auth-rules" %}}

View file

@ -57,6 +57,8 @@ Events in rooms of this version have the following structure:
{{% rver-fragment name="v1-stringy-power-levels" %}}
{{% rver-fragment name="v1-floaty-power-levels" %}}
### Authorization rules
{{% rver-fragment name="v1-auth-rules" %}}

View file

@ -87,6 +87,8 @@ The complete structure of a event in a v3 room is shown below.
{{% rver-fragment name="v1-stringy-power-levels" %}}
{{% rver-fragment name="v1-floaty-power-levels" %}}
### Authorization rules
{{% boxes/note %}}

View file

@ -76,6 +76,8 @@ the changes in this room version.
{{% rver-fragment name="v1-stringy-power-levels" %}}
{{% rver-fragment name="v1-floaty-power-levels" %}}
### Authorization rules
{{% rver-fragment name="v3-auth-rules" %}}

View file

@ -58,6 +58,8 @@ completeness.
{{% rver-fragment name="v1-stringy-power-levels" %}}
{{% rver-fragment name="v1-floaty-power-levels" %}}
### Authorization rules
{{% rver-fragment name="v3-auth-rules" %}}

View file

@ -34,10 +34,10 @@ paths:
- in: query
name: minimum_valid_until_ts
description: |-
A millisecond POSIX timestamp in milliseconds indicating when the returned
certificates will need to be valid until to be useful to the requesting server.
A millisecond POSIX timestamp. The returned keys SHOULD be valid
until at least this timestamp.
If not supplied, the current time as determined by the notary server is used.
If not supplied, the notary server MUST use the current time.
required: false
example: 1234567890
schema:
@ -98,12 +98,11 @@ paths:
type: integer
format: int64
description: |-
A millisecond POSIX timestamp in milliseconds indicating when
the returned certificates will need to be valid until to be
useful to the requesting server.
A millisecond POSIX timestamp. The returned keys
SHOULD be valid until at least this timestamp.
If not supplied, the current time as determined by the notary
server is used.
If not supplied, the notary server MUST use the
current time.
example: 1234567890
required:
- server_keys