mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-10 14:09:59 -04:00
Fix a long-standing bug where an initial sync would not respond to changes to the list of ignored users if there was an initial sync cached. (#15163)
This commit is contained in:
parent
682d31c702
commit
d62cd940cb
4 changed files with 77 additions and 2 deletions
|
@ -140,3 +140,25 @@ class IgnoredUsersTestCase(unittest.HomeserverTestCase):
|
|||
# No one ignores the user now.
|
||||
self.assert_ignored(self.user, set())
|
||||
self.assert_ignorers("@other:test", set())
|
||||
|
||||
def test_ignoring_users_with_latest_stream_ids(self) -> None:
|
||||
"""Test that ignoring users updates the latest stream ID for the ignored
|
||||
user list account data."""
|
||||
|
||||
def get_latest_ignore_streampos(user_id: str) -> Optional[int]:
|
||||
return self.get_success(
|
||||
self.store.get_latest_stream_id_for_global_account_data_by_type_for_user(
|
||||
user_id, AccountDataTypes.IGNORED_USER_LIST
|
||||
)
|
||||
)
|
||||
|
||||
self.assertIsNone(get_latest_ignore_streampos("@user:test"))
|
||||
|
||||
self._update_ignore_list("@other:test", "@another:remote")
|
||||
|
||||
self.assertEqual(get_latest_ignore_streampos("@user:test"), 2)
|
||||
|
||||
# Add one user, remove one user, and leave one user.
|
||||
self._update_ignore_list("@foo:test", "@another:remote")
|
||||
|
||||
self.assertEqual(get_latest_ignore_streampos("@user:test"), 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue