Clear message queue before and after removing a device

This commit is contained in:
Chris Eager authored and Chris Eager committed 2021-07-02 10:48:42 -05:00
1 parent e52b8c8423
commit 26bc5973b5
2 files changed
+28

No files matched your search

@@ -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);
}