summary refs log tree commit diff
path: root/tests/server.py (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-08-07Sliding Sync: Use `stream_ordering` based timeline pagination for ↵Eric Eastwood9-126/+311
incremental sync (#17510) Use `stream_ordering` based `timeline` pagination for incremental `/sync` in Sliding Sync. Previously, we were always using a `topological_ordering` but we should only be using that for historical scenarios (initial `/sync`, newly joined, or haven't sent the room down the connection before). This is slightly different than what the [spec suggests](https://spec.matrix.org/v1.10/client-server-api/#syncing) > Events are ordered in this API according to the arrival time of the event on the homeserver. This can conflict with other APIs which order events based on their partial ordering in the event graph. This can result in duplicate events being received (once per distinct API called). Clients SHOULD de-duplicate events based on the event ID when this happens. But we've had a [discussion below in this PR](https://github.com/element-hq/synapse/pull/17510#discussion_r1699105569) and this matches what Sync v2 already does and seems like it makes sense. Created a spec issue https://github.com/matrix-org/matrix-spec/issues/1917 to clarify this. Related issues: - https://github.com/matrix-org/matrix-spec/issues/1917 - https://github.com/matrix-org/matrix-spec/issues/852 - https://github.com/matrix-org/matrix-spec-proposals/pull/4033
2024-08-07Bump bytes from 1.6.1 to 1.7.1 (#17526)dependabot[bot]1-2/+2
2024-08-07Bump regex from 1.10.5 to 1.10.6 (#17527)dependabot[bot]1-2/+2
2024-08-07Fixup sliding sync comment (#17531)Erik Johnston2-1/+2
c.f. https://github.com/element-hq/synapse/pull/17529#discussion_r1705780925
2024-08-06Sliding Sync: Add more tracing (#17514)Eric Eastwood6-240/+346
Spawning from looking at a couple traces and wanting a little more info. Follow-up to github.com/element-hq/synapse/pull/17501 The changes in this PR allow you to find slow Sliding Sync traces ignoring the `wait_for_events` time. In Jaeger, you can now filter for the `current_sync_for_user` operation with `RESULT.result=true` indicating that it actually returned non-empty results. If you want to find traces for your own user, you can use `RESULT.result=true ARG.sync_config.user="@madlittlemods:matrix.org"`
2024-08-06Clarify `auto_accept_invites.worker_to_run_on` config docs (#17515)Andrew Morgan2-1/+6
2024-08-061.113.0rc1 v1.113.0rc1 github/release-v1.113 release-v1.113Andrew Morgan20-18/+51
2024-08-06Bump phonenumbers from 8.13.39 to 8.13.42 (#17521)dependabot[bot]1-3/+3
2024-08-06Bump towncrier from 23.11.0 to 24.7.1 (#17523)dependabot[bot]1-5/+5
2024-08-06Bump black from 24.4.2 to 24.8.0 (#17522)dependabot[bot]1-25/+25
2024-08-06Bump serde_json from 1.0.121 to 1.0.122 (#17525)dependabot[bot]1-2/+2
2024-08-06SS: Reset connection if token is unrecognized (#17529)Erik Johnston4-17/+57
This triggers the client to start a new sliding sync connection. If we don't do this and the client asks for the full range of rooms, we end up sending down all rooms and their state from scratch (which can be very slow) This causes things like https://github.com/element-hq/element-x-ios/issues/3115 after we restart the server --------- Co-authored-by: Eric Eastwood <eric.eastwood@beta.gouv.fr>
2024-08-05Sliding Sync: Easier to understand timeline assertions in tests (#17511)Eric Eastwood2-21/+104
Added `_assertTimelineEqual(...)` because I got fed up trying to understand the crazy diffs from the standard `self.assertEqual(...)`/`self.assertListEqual(...)` Before: ``` [FAIL] Traceback (most recent call last): File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 103, in test_rooms_limited_initial_sync self.assertListEqual( File "/usr/lib/python3.12/unittest/case.py", line 1091, in assertListEqual self.assertSequenceEqual(list1, list2, msg, seq_type=list) File "/usr/lib/python3.12/unittest/case.py", line 1073, in assertSequenceEqual self.fail(msg) twisted.trial.unittest.FailTest: Lists differ: ['$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0w[95 chars]isM'] != ['$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4[95 chars]nnU'] First differing element 0: '$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA' '$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E' - ['$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA', - '$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E', ? ^ + ['$8N1XJ7e-3K_wxAanLVD3v8KQ96_B5Xj4huGkgy4N4-E', ? ^ - '$q4PRxQ_pBZkQI1keYuZPTtExQ23DqpUI3-Lxwfj_isM'] + '$4QcmnzhdazSnDYcYSZCS_6-MWSzM_dN3RC7TRvW0wWA', + '$j3Xj-t2F1wH9kUHsI8X5yqS7hkdSyN2owaArfvk8nnU'] ``` After: ``` [FAIL] Traceback (most recent call last): File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 178, in test_rooms_limited_initial_sync self._assertTimelineEqual( File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 110, in _assertTimelineEqual self._assertListEqual( File "/home/eric/Documents/github/element/synapse/tests/rest/client/sliding_sync/test_rooms_timeline.py", line 79, in _assertListEqual self.fail(f"{diff_message}\n{message}") twisted.trial.unittest.FailTest: Items must Expected items to be in actual ('?' = missing expected items): [ (10, master) $w-BoqW1PQQFU4TzVJW5OIelugxh0mY12wrfw6mbC6D4 (m.room.message) activity4 (11, master) $sSidTZf1EOQmCVDU4mrH_1-bopMQhwcDUO2IhoemR6M (m.room.message) activity5 ? (12, master) $bgOcc3D-2QSkbk4aBxKVyOOQJGs7ZuncRJwG3cEANZg (m.room.member, @user1:test) join ] Actual ('+' = found expected items): [ + (11, master) $sSidTZf1EOQmCVDU4mrH_1-bopMQhwcDUO2IhoemR6M (m.room.message) activity5 + (10, master) $w-BoqW1PQQFU4TzVJW5OIelugxh0mY12wrfw6mbC6D4 (m.room.message) activity4 (9, master) $FmCNyc11YeFwiJ4an7_q6H0LCCjQOKd6UCr5VKeXXUw (m.room.message, None) activity3 ] ```
2024-07-31Sliding Sync: Add typing notification extension (MSC3961) (#17505)Eric Eastwood9-7/+640
[MSC3961](https://github.com/matrix-org/matrix-spec-proposals/pull/3961): Sliding Sync Extension: Typing Notifications Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
2024-07-31Sliding Sync: Split and move tests (#17504)Eric Eastwood15-5860/+6315
Split and move Sliding Sync tests so we have some more sane test file sizes
2024-07-31Sliding Sync: Fix `limited` response description (make accurate) (#17507)Eric Eastwood2-2/+3
2024-07-30Sliding Sync: Update filters to be robust against remote invite rooms (#17450)Eric Eastwood11-109/+1597
Update `filters.is_encrypted` and `filters.types`/`filters.not_types` to be robust when dealing with remote invite rooms in Sliding Sync. Part of [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync Follow-up to https://github.com/element-hq/synapse/pull/17434 We now take into account current state, fallback to stripped state for invite/knock rooms, then historical state. If we can't determine the info needed to filter a room (either from state or stripped state), it is filtered out.
2024-07-30Sliding Sync: Add receipts extension (MSC3960) (#17489)Eric Eastwood7-268/+1070
[MSC3960](https://github.com/matrix-org/matrix-spec-proposals/pull/3960): Receipts extension Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
2024-07-30Bump types-setuptools from 70.1.0.20240627 to 71.1.0.20240726 (#17497)dependabot[bot]1-3/+3
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30Bump types-pyopenssl from 24.1.0.20240425 to 24.1.0.20240722 (#17496)dependabot[bot]1-3/+3
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30Bump bcrypt from 4.1.3 to 4.2.0 (#17495)dependabot[bot]1-28/+28
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30Bump serde_json from 1.0.120 to 1.0.121 (#17493)dependabot[bot]1-2/+3
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-301.112.0 v1.112.0 github/release-v1.112 release-v1.112Olivier 'reivilibre4-2/+32
2024-07-30Upgrade locked dependency on Twisted to 24.7.0rc1. (#17502)reivilibre8-57/+65
I also update the tests and HTTP Proxy code to fix it for this new Twisted release. Pulls in fix for https://github.com/twisted/twisted/security/advisories/GHSA-c8m8-j448-xjx7 Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2024-07-30Add bold emphasis to some parts of the changelog v1.111.1 github/release-v1.111 release-v1.111Olivier 'reivilibre1-2/+2
2024-07-301.111.1Olivier 'reivilibre4-2/+27
2024-07-30Upgrade locked dependency on Twisted to 24.7.0rc1. (#17502)reivilibre8-57/+65
I also update the tests and HTTP Proxy code to fix it for this new Twisted release. Pulls in fix for https://github.com/twisted/twisted/security/advisories/GHSA-c8m8-j448-xjx7 Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>