24 Commits

Author SHA1 Message Date
Kegan Dougal
7ea0b711db Check for lower 2024-06-04 17:22:43 +01:00
Kegan Dougal
17cb5f0376 Check the returned next_batch 2024-06-04 17:00:31 +01:00
Kegan Dougal
91a1a56f64 Add test 2024-06-04 16:57:57 +01:00
Kegan Dougal
451f6fb9c8 Add regression test 2024-05-20 14:02:29 +01:00
Kegan Dougal
c5b0afb2be bugfix: ensure we send back device list updates at the correct time
Otherwise we can cause lost device list updates if the client resets
the connection (as the device list update won't be in any in-memory cache).
2024-05-09 12:36:18 +01:00
Kegan Dougal
d3285a39f1
Always ensure integ tests send a timeline event when sending state 2023-08-22 16:10:52 +01:00
Till Faelligen
2ced1986b4
Wait for responses to be processed 2023-08-02 14:04:32 +02:00
Till Faelligen
d357aa234f
Update test again to validate that we don't see Charlie typing 2023-08-02 10:57:22 +02:00
Till Faelligen
1b1d00db95
Update test a bit 2023-08-01 13:11:28 +02:00
Till Faelligen
86c4f18c7e
Add test to validate that only one poller is allowed to change typing
notifications
2023-07-31 15:16:54 +02:00
David Robertson
9982ab24ee
Use different device names for each test 2023-05-15 19:14:09 +01:00
David Robertson
0609cc51d2
Logging tweaks 2023-04-28 18:50:50 +01:00
David Robertson
0de818a796
s/Enabled/Core/g 2023-03-28 13:53:57 +01:00
Kegan Dougal
05ddb6812b extensions refactor: automatically handle the enabled flag
Part of a series of refactors on the extensions code.
2023-02-08 11:30:54 +00:00
Kegan Dougal
27485f90cc bugfix: allow extensions to be enabled late; with regression tests 2023-02-07 17:36:43 +00:00
Kegan Dougal
2ae1ff7f15 Unbreak tests 2023-01-18 15:31:44 +00:00
kegsay
d5af0266c8
Merge branch 'main' into kegan/lists-as-keys 2023-01-18 15:25:03 +00:00
Kegan Dougal
95a5af3abe perf: immediately send to-device messages to listening conns 2023-01-09 11:53:17 +00:00
Kegan Dougal
6c4f7d3722 improvement: completely refactor device data updates
- `Conn`s now expose a direct `OnUpdate(caches.Update)` function
  for updates which concern a specific device ID.
- Add a bitset in `DeviceData` to indicate if the OTK or fallback keys were changed.
- Pass through the affected `DeviceID` in `pubsub.V2DeviceData` updates.
- Remove `DeviceDataTable.SelectFrom` as it was unused.
- Refactor how the poller invokes `OnE2EEData`: it now only does this if
  there are changes to OTK counts and/or fallback key types and/or device lists,
  and _only_ sends those fields, setting the rest to the zero value.
- Remove noisy logging.
- Add `caches.DeviceDataUpdate` which has no data but serves to wake-up the long poller.
- Only send OTK counts / fallback key types when they have changed, not constantly. This
  matches the behaviour described in MSC3884

The entire flow now looks like:
- Poller notices a diff against in-memory version of otk count and invokes `OnE2EEData`
- Handler updates device data table, bumps the changed bit for otk count.
- Other handler gets the pubsub update, directly finds the `Conn` based on the `DeviceID`.
  Invokes `OnUpdate(caches.DeviceDataUpdate)`
- This update is handled by the E2EE extension which then pulls the data out from the database
  and returns it.
- On initial connections, all OTK / fallback data is returned.
2022-12-22 15:08:42 +00:00
Kegan Dougal
ca6ceb28da BREAKING: Change the API to refer to lists by keys not index positions
This provides more flexibility to refer to lists as well as delete them.
2022-12-20 13:32:39 +00:00
Kegan Dougal
aa28df161c Rename package -> github.com/matrix-org/sliding-sync 2022-12-15 11:08:50 +00:00
Kegan Dougal
47ddc04652 E2EE extension: Add support for device_unused_fallback_key_types
With tests
2022-08-09 10:05:18 +01:00
Kegan Dougal
5b0e8568ea tests: move Match* functions to testutils/m
In preparation for migrating end-to-end style integration tests
to be actual end-to-end tests. The intended split is:
 - Does the test exclusively use the public sliding sync API for test assertions?
 - Does the test exclusively use the public sync v2 API for configuring the test?
If the answer to both questions is YES, then they should be end-to-end tests.
Some examples of this include testing core functionality of the API like
room subscriptions, multiple lists, filters, extensions, etc.

Some examples of tests which are NOT end-to-end tests include:
 - Testing connection handling (e.g sending multiple duplicate requests)
 - Ensuring outstanding requests get cancelled.
 - Testing restarts of the proxy.
 - Testing out-of-order responses.
 - Benchmarks.

These all involve configuring the test / asserting different things, which would
be extremely difficult to reliably engineer using a real homeserver.
2022-07-26 10:11:06 +01:00
Kegan Dougal
75c3579f9e refactor: move integration tests to tests-integration directory
Add tests-e2ee directory for end-to-end tests which require a synapse
server.
2022-07-25 15:06:13 +01:00