Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't mark newly joined room timelines as limited in an incremental sync #337

Merged
merged 2 commits into from
Oct 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion synapse/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def serialize_event(e, time_now_ms, as_client_event=True,

if "redacted_because" in e.unsigned:
d["unsigned"]["redacted_because"] = serialize_event(
e.unsigned["redacted_because"], time_now_ms
e.unsigned["redacted_because"], time_now_ms,
event_format=event_format
)

if token_id is not None:
Expand Down
10 changes: 6 additions & 4 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def incremental_sync_with_gap(self, sync_config, since_token):
else:
prev_batch = now_token

state = yield self.check_joined_room(
state, limited = yield self.check_joined_room(
sync_config, room_id, state
)

Expand All @@ -396,7 +396,7 @@ def incremental_sync_with_gap(self, sync_config, since_token):
timeline=TimelineBatch(
events=recents,
prev_batch=prev_batch,
limited=False,
limited=limited,
),
state=state,
ephemeral=typing_by_room.get(room_id, [])
Expand Down Expand Up @@ -520,7 +520,7 @@ def incremental_sync_with_gap_for_room(self, room_id, sync_config,
current_state=current_state_events,
)

state_events_delta = yield self.check_joined_room(
state_events_delta, _ = yield self.check_joined_room(
sync_config, room_id, state_events_delta
)

Expand Down Expand Up @@ -627,6 +627,7 @@ def compute_state_delta(self, since_token, previous_state, current_state):
@defer.inlineCallbacks
def check_joined_room(self, sync_config, room_id, state_delta):
joined = False
limited = False
for event in state_delta:
if (
event.type == EventTypes.Member
Expand All @@ -638,5 +639,6 @@ def check_joined_room(self, sync_config, room_id, state_delta):
if joined:
res = yield self.state_handler.get_current_state(room_id)
state_delta = res.values()
limited = True

defer.returnValue(state_delta)
defer.returnValue((state_delta, limited))
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ commands =
check-manifest

[testenv:pep8]
skip_install = True
basepython = python2.7
deps =
flake8
Expand Down