Skip to content

Commit ba4e63b

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

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

synapse/handlers/sliding_sync.py

+12-6
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
@@ -2496,7 +2501,8 @@ async def get_room_sync_data(
24962501
# FIXME: We signal the fact that we're sending down more events to
24972502
# the client by setting `initial=true` *without* sending down all
24982503
# the state/metadata again, which is what the proxy does. We should
2499-
# update the protocol to do something less silly.
2504+
# update the protocol to do something less silly (see "XXX: Odd
2505+
# behavior" above).
25002506
initial = True
25012507

25022508
new_connection_state.room_configs[room_id] = RoomSyncConfig(

0 commit comments

Comments
 (0)