Skip to content

Commit

Permalink
Add comment explaining the odd behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Aug 19, 2024
1 parent 299ab1b commit d2b801e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions synapse/handlers/sliding_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,11 +2012,15 @@ async def get_room_sync_data(
# - For an incremental sync where we haven't sent it down this
# connection before
#
# Relevant spec issue: https://github.com/matrix-org/matrix-spec/issues/1917
# Relevant spec issue:
# https://github.com/matrix-org/matrix-spec/issues/1917
#
# We also need to check if the timeline limit has increased, if so we ignore
# the from bound for the timeline to send down a larger chunk of
# history.
# XXX: Odd behavior - We also check if the `timeline_limit` has
# increased, if so we ignore the from bound for the timeline to send
# down a larger chunk of history with `initial: True`. This is matches
# the behavior of the Sliding Sync proxy and is what e.g. ElementX
# currently expects. In future this behavior is almost certianly going
# to change
#
# TODO: Also handle changes to `required_state`
from_bound = None
Expand All @@ -2042,7 +2046,8 @@ async def get_room_sync_data(
prev_room_sync_config = previous_connection_state.room_configs.get(room_id)
if prev_room_sync_config is not None:
# Check if the timeline limit has increased, if so ignore the
# timeline bound and record the change.
# timeline bound and record the change (see "XXX: Odd behavior"
# above).
if (
prev_room_sync_config.timeline_limit
< room_sync_config.timeline_limit
Expand Down

0 comments on commit d2b801e

Please sign in to comment.