pull/7453/head
Brendan Abolivier 2020-05-12 11:53:38 +02:00
parent ff6e16f7a3
commit d6d20371a7
No known key found for this signature in database
GPG Key ID: 1E015C145F1916CD
1 changed files with 16 additions and 12 deletions

View File

@ -180,24 +180,28 @@ class MessageAcceptTests(unittest.HomeserverTestCase):
# Manually inject a fake device list update. We need this update to include at # Manually inject a fake device list update. We need this update to include at
# least one prev_id so that the user's device list will need to be retried. # least one prev_id so that the user's device list will need to be retried.
device_list_updater = self.homeserver.get_device_handler().device_list_updater device_list_updater = self.homeserver.get_device_handler().device_list_updater
self.get_success(device_list_updater.incoming_device_list_update( self.get_success(
origin=remote_origin, device_list_updater.incoming_device_list_update(
edu_content={ origin=remote_origin,
"deleted": False, edu_content={
"device_display_name": "Mobile", "deleted": False,
"device_id": "QBUAZIFURK", "device_display_name": "Mobile",
"prev_id": [5], "device_id": "QBUAZIFURK",
"stream_id": 6, "prev_id": [5],
"user_id": remote_user_id, "stream_id": 6,
} "user_id": remote_user_id,
)) }
)
)
# Check that there was one resync attempt. # Check that there was one resync attempt.
self.assertEqual(self.resync_attempts, 1) self.assertEqual(self.resync_attempts, 1)
# Check that the resync attempt failed and caused the user's device list to be # Check that the resync attempt failed and caused the user's device list to be
# marked as stale. # marked as stale.
need_resync = self.get_success(store.get_user_ids_requiring_device_list_resync()) need_resync = self.get_success(
store.get_user_ids_requiring_device_list_resync()
)
self.assertIn(remote_user_id, need_resync) self.assertIn(remote_user_id, need_resync)
# Check that waiting for 30 seconds caused Synapse to retry resyncing the device # Check that waiting for 30 seconds caused Synapse to retry resyncing the device