matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
170 stars 90 forks source link

Order field in m.tag is a float even though Canonical JSON forbids floats #1864

Closed Johennes closed 2 weeks ago

Johennes commented 2 weeks ago

Link to problem area:

https://spec.matrix.org/v1.10/client-server-api/#mtag

Issue

The order field in the content of m.tag is spec'ed as a number between 0 and 1. However, Canonical JSON explicitly forbids floating point numbers.

https://github.com/matrix-org/matrix-spec/issues/615#issuecomment-1055933309 mentions "a mess with strings vs. floats in tag orders" but I couldn't find where any place that discusses this further.

richvdh commented 2 weeks ago

The order field in the content of m.tag is spec'ed as a number between 0 and 1. However, Canonical JSON explicitly forbids floating point numbers.

I don't think that matters? m.tag is account data, which is never encoded as Canonical JSON?

Johennes commented 2 weeks ago

Err, yes you're right. My bad, apologies. 🤦