Skip to content

Add 413 error to /sendToDevice#2340

Draft
MatMaul wants to merge 1 commit into
matrix-org:mainfrom
tchapgouv:413-sendToDevice
Draft

Add 413 error to /sendToDevice#2340
MatMaul wants to merge 1 commit into
matrix-org:mainfrom
tchapgouv:413-sendToDevice

Conversation

@MatMaul
Copy link
Copy Markdown

@MatMaul MatMaul commented Mar 20, 2026

Related synapse PR: element-hq/synapse#18416

Pull Request Checklist

Copy link
Copy Markdown
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

I'm seeing that this is a draft, but this will need an MSC.

MadLittleMods added a commit to element-hq/synapse that referenced this pull request Mar 24, 2026
If a set of messages exceeds this limit, the messages are split
across several EDUs.

Fix #17035 (should)

There is currently [no official specced limit for
EDUs](matrix-org/matrix-spec#807), but the
consensus seems to be that it would be useful to have one to avoid this
bug by bounding the transaction size.

As a side effect it also limits the size of a single to-device message
to a bit less than 65536.

This should probably be added to the spec similarly to the [message size
limit.](https://spec.matrix.org/v1.14/client-server-api/#size-limits)

Spec PR: matrix-org/matrix-spec#2340

---------

Co-authored-by: mcalinghee <mcalinghee.dev@gmail.com>
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
erikjohnston pushed a commit to element-hq/synapse that referenced this pull request Mar 27, 2026
If a set of messages exceeds this limit, the messages are split
across several EDUs.

Fix #17035 (should)

There is currently [no official specced limit for
EDUs](matrix-org/matrix-spec#807), but the
consensus seems to be that it would be useful to have one to avoid this
bug by bounding the transaction size.

As a side effect it also limits the size of a single to-device message
to a bit less than 65536.

This should probably be added to the spec similarly to the [message size
limit.](https://spec.matrix.org/v1.14/client-server-api/#size-limits)

Spec PR: matrix-org/matrix-spec#2340

---------

Co-authored-by: mcalinghee <mcalinghee.dev@gmail.com>
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
value: {
"errcode": "M_TOO_LARGE",
"error": "device message to @test:example.com too large to fit in a single EDU"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cross-linking discussion thread this is spawning from element-hq/synapse#18416 (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.

3 participants