@@ -2012,11 +2012,15 @@ async def get_room_sync_data(
2012
2012
# - For an incremental sync where we haven't sent it down this
2013
2013
# connection before
2014
2014
#
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
2016
2017
#
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
2020
2024
#
2021
2025
# TODO: Also handle changes to `required_state`
2022
2026
from_bound = None
@@ -2042,7 +2046,8 @@ async def get_room_sync_data(
2042
2046
prev_room_sync_config = previous_connection_state .room_configs .get (room_id )
2043
2047
if prev_room_sync_config is not None :
2044
2048
# 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).
2046
2051
if (
2047
2052
prev_room_sync_config .timeline_limit
2048
2053
< room_sync_config .timeline_limit
@@ -2496,7 +2501,8 @@ async def get_room_sync_data(
2496
2501
# FIXME: We signal the fact that we're sending down more events to
2497
2502
# the client by setting `initial=true` *without* sending down all
2498
2503
# 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).
2500
2506
initial = True
2501
2507
2502
2508
new_connection_state .room_configs [room_id ] = RoomSyncConfig (
0 commit comments