mirror of
https://github.com/element-hq/synapse.git
synced 2026-05-15 03:45:41 +00:00
Apply suggestions from code review
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
This commit is contained in:
@@ -196,9 +196,9 @@ class SlidingSyncHandler:
|
||||
sync_config.user.to_string(),
|
||||
timeout_ms,
|
||||
current_sync_callback,
|
||||
# We *wait* from `now_token` as we have already computed the sync
|
||||
# response up to `now_token` above, so we want to wait for something
|
||||
# new to arrive after `now_token`.
|
||||
# We *wait* from `now_token` as we have already computed the sync response
|
||||
# up to `now_token` above, so as a minor optimization, we can wait for
|
||||
# something new to arrive after `now_token`.
|
||||
#
|
||||
# We still generate the sync response using `from_token` in the
|
||||
# callback above though.
|
||||
|
||||
@@ -2247,8 +2247,8 @@ class SlidingSyncRoomsRequiredStateTestCase(SlidingSyncBase):
|
||||
)
|
||||
|
||||
def test_changing_required_state_returns_immediately(self) -> None:
|
||||
"""Test that if we change the required state, then we return immediately
|
||||
with the new required state."""
|
||||
"""Test that if we change the `required_state`, then we return immediately
|
||||
with the new `required_state`."""
|
||||
|
||||
user1_id = self.register_user("user1", "pass")
|
||||
user1_tok = self.login(user1_id, "pass")
|
||||
@@ -2281,7 +2281,7 @@ class SlidingSyncRoomsRequiredStateTestCase(SlidingSyncBase):
|
||||
sync_body,
|
||||
since=from_token,
|
||||
tok=user1_tok,
|
||||
timeout_ms=10_000,
|
||||
timeout_ms=Duration(seconds=10).as_millis(),
|
||||
await_result=False,
|
||||
)
|
||||
self.reactor.advance(0.1) # Allow the request to start processing
|
||||
@@ -2293,7 +2293,7 @@ class SlidingSyncRoomsRequiredStateTestCase(SlidingSyncBase):
|
||||
self.reactor.advance(1)
|
||||
self.assertTrue(channel.is_finished())
|
||||
|
||||
# Now update the sliding sync requests to include a required state
|
||||
# Now update the Sliding Sync requests to include a `required_state`
|
||||
# event, and make another sync request.
|
||||
sync_body["lists"]["foo-list"]["required_state"] = [
|
||||
[EventTypes.Create, ""],
|
||||
@@ -2303,7 +2303,7 @@ class SlidingSyncRoomsRequiredStateTestCase(SlidingSyncBase):
|
||||
sync_body, since=from_token, tok=user1_tok, timeout_ms=10_000
|
||||
)
|
||||
|
||||
# We should see the new required state immediately without waiting.
|
||||
# We should see the new `required_state` immediately without waiting.
|
||||
self._assertRequiredStateIncludes(
|
||||
response_body["rooms"][room_id1]["required_state"],
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user