Skip to content

Commit d2b801e

Browse files
committed
Add comment explaining the odd behaviour
1 parent 299ab1b commit d2b801e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

synapse/handlers/sliding_sync.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -2012,11 +2012,15 @@ async def get_room_sync_data(
20122012
# - For an incremental sync where we haven't sent it down this
20132013
# connection before
20142014
#
2015-
# Relevant spec issue: https://github.com/matrix-org/matrix-spec/issues/1917
2015+
# Relevant spec issue:
2016+
# https://github.com/matrix-org/matrix-spec/issues/1917
20162017
#
2017-
# We also need to check if the timeline limit has increased, if so we ignore
2018-
# the from bound for the timeline to send down a larger chunk of
2019-
# history.
2018+
# XXX: Odd behavior - We also check if the `timeline_limit` has
2019+
# increased, if so we ignore the from bound for the timeline to send
2020+
# down a larger chunk of history with `initial: True`. This is matches
2021+
# the behavior of the Sliding Sync proxy and is what e.g. ElementX
2022+
# currently expects. In future this behavior is almost certianly going
2023+
# to change
20202024
#
20212025
# TODO: Also handle changes to `required_state`
20222026
from_bound = None
@@ -2042,7 +2046,8 @@ async def get_room_sync_data(
20422046
prev_room_sync_config = previous_connection_state.room_configs.get(room_id)
20432047
if prev_room_sync_config is not None:
20442048
# Check if the timeline limit has increased, if so ignore the
2045-
# timeline bound and record the change.
2049+
# timeline bound and record the change (see "XXX: Odd behavior"
2050+
# above).
20462051
if (
20472052
prev_room_sync_config.timeline_limit
20482053
< room_sync_config.timeline_limit

0 commit comments

Comments
 (0)