When re-syncing device lists reset the state

We keep track of what stream IDs we've seen so that we know what updates
we've handled or missed. If we re-sync we don't know if the updates
we've seen are included in the re-sync (there may be a race), so we
should reset the seen updates.
pull/4829/head
Erik Johnston 2019-03-07 16:04:24 +00:00
parent fde26e47d6
commit d42b41544a
1 changed files with 7 additions and 3 deletions

View File

@ -566,6 +566,10 @@ class DeviceListEduUpdater(object):
) )
device_ids = [device["device_id"] for device in devices] device_ids = [device["device_id"] for device in devices]
yield self.device_handler.notify_device_update(user_id, device_ids) yield self.device_handler.notify_device_update(user_id, device_ids)
# We clobber the seen updates since we've re-synced from a given
# point.
self._seen_updates[user_id] = set([stream_id])
else: else:
# Simply update the single device, since we know that is the only # Simply update the single device, since we know that is the only
# change (because of the single prev_id matching the current cache) # change (because of the single prev_id matching the current cache)