Skip to content

Enforce type, sender, state_key and room_id lengths using bytes rather than codepoints#338

Merged
neilalexander merged 1 commit into
mainfrom
neilalexander/spec1001
Oct 21, 2022
Merged

Enforce type, sender, state_key and room_id lengths using bytes rather than codepoints#338
neilalexander merged 1 commit into
mainfrom
neilalexander/spec1001

Conversation

@neilalexander
Copy link
Copy Markdown
Contributor

This effectively reverts the change made in 5f66df0 to bytes instead of codepoints, since Synapse will now enforce the same after matrix-org/synapse#13710.

History here is that Synapse originally calculated bytes in Python 2.x, started counting codepoints in Python 3.x pretty much by accident and then the spec was ambiguous after the fact (hence matrix-org/matrix-spec#1001).

Rationale is that bytes are probably easier for implementations to manage and less likely to generate huge indexes for client-side databases (especially where limits might exist like LMDB).

cc @reivilibre

@DMRobertson
Copy link
Copy Markdown
Contributor

History here is that Synapse originally calculated bytes in Python 2.x,

We later realised this is not the case: see Olivier's writeup in matrix-org/matrix-spec#1001 (comment)

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