summary refs log tree commit diff
path: root/synapse/api/constants.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2025-03-26 22:00:52 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2025-03-26 22:00:52 +0000
commit2830013e5ed88822e487a90c0ba6cf7ab86bd358 (patch)
treed0dc3eb341be7ee51e41bdcf6911546bc1796839 /synapse/api/constants.py
parentAdd docs for how to clear out the Poetry wheel cache (#18283) (diff)
parent1.127.1 (diff)
downloadsynapse-2830013e5ed88822e487a90c0ba6cf7ab86bd358.tar.xz
Merge branch 'master' into develop
Diffstat (limited to 'synapse/api/constants.py')
-rw-r--r--synapse/api/constants.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/api/constants.py b/synapse/api/constants.py

index 9806e2b0fe..c564a8635a 100644 --- a/synapse/api/constants.py +++ b/synapse/api/constants.py
@@ -29,8 +29,13 @@ from typing import Final # the max size of a (canonical-json-encoded) event MAX_PDU_SIZE = 65536 -# the "depth" field on events is limited to 2**63 - 1 -MAX_DEPTH = 2**63 - 1 +# Max/min size of ints in canonical JSON +CANONICALJSON_MAX_INT = (2**53) - 1 +CANONICALJSON_MIN_INT = -CANONICALJSON_MAX_INT + +# the "depth" field on events is limited to the same as what +# canonicaljson accepts +MAX_DEPTH = CANONICALJSON_MAX_INT # the maximum length for a room alias is 255 characters MAX_ALIAS_LENGTH = 255