Clear message queue before and after removing a device

This commit is contained in:
Chris Eager
2021-07-01 13:16:03 -05:00
committed by Chris Eager
parent e52b8c8423
commit 26bc5973b5
2 changed files with 28 additions and 0 deletions

View File

@@ -99,9 +99,11 @@ public class DeviceController {
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
}
messages.clear(account.getUuid(), deviceId);
account.removeDevice(deviceId);
accounts.update(account);
directoryQueue.refreshRegisteredUser(account);
// ensure any messages that came in after the first clear() are also removed
messages.clear(account.getUuid(), deviceId);
}