forked-synapse/tests/util
Richard van der Hoff 13683a3a22
Extend StreamChangeCache to support multiple entities per stream ID (#7303)
First some background: StreamChangeCache is used to keep track of what "entities" have 
changed since a given stream ID. So for example, we might use it to keep track of when the last
to-device message for a given user was received [1], and hence whether we need to pull any to-device messages from the database on a sync [2].

Now, it turns out that StreamChangeCache didn't support more than one thing being changed at
a given stream_id (this was part of the problem with #7206). However, it's entirely valid to send
to-device messages to more than one user at a time.

As it turns out, this did in fact work, because *some* methods of StreamChangeCache coped
ok with having multiple things changing on the same stream ID, and it seems we never actually
use the methods which don't work on the stream change caches where we allow multiple
changes at the same stream ID. But that feels horribly fragile, hence: let's update
StreamChangeCache to properly support this, and add some typing and some more tests while
we're at it.

[1]: https://github.com/matrix-org/synapse/blob/release-v1.12.3/synapse/storage/data_stores/main/deviceinbox.py#L301
[2]: https://github.com/matrix-org/synapse/blob/release-v1.12.3/synapse/storage/data_stores/main/deviceinbox.py#L47-L51
2020-04-22 13:45:40 +01:00
..
caches Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00
__init__.py Fix flake8 warnings for tests 2016-02-19 15:34:38 +00:00
test_async_utils.py Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00
test_dict_cache.py Run black. 2018-08-10 23:54:09 +10:00
test_expiring_cache.py Fix some instances of ExpiringCache not expiring cache items 2018-09-21 14:19:46 +01:00
test_file_consumer.py Run black. 2018-08-10 23:54:09 +10:00
test_itertools.py Log saml assertions rather than the whole response 2020-01-16 22:26:34 +00:00
test_linearizer.py Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00
test_logcontext.py Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00
test_logformatter.py Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2019-07-04 00:07:04 +10:00
test_lrucache.py Run black. 2018-08-10 23:54:09 +10:00
test_ratelimitutils.py Fixes to the federation rate limiter (#5621) 2019-07-05 11:10:19 +01:00
test_retryutils.py Add 'failure_ts' column to 'destinations' table (#6016) 2019-09-17 11:41:54 +01:00
test_rwlock.py Run black. 2018-08-10 23:54:09 +10:00
test_stream_change_cache.py Extend StreamChangeCache to support multiple entities per stream ID (#7303) 2020-04-22 13:45:40 +01:00
test_stringutils.py Validate client_secret parameter (#6767) 2020-01-24 14:28:40 +00:00
test_treecache.py run isort 2018-07-09 16:09:20 +10:00
test_wheel_timer.py run isort 2018-07-09 16:09:20 +10:00