From 5b4f2762e5ed32a9a6b1781e0552b4df44481bbc Mon Sep 17 00:00:00 2001 From: kske Date: Tue, 22 Sep 2020 16:06:19 +0200 Subject: [PATCH] Fix synchronization when initializing user storage --- client/src/main/java/envoy/client/data/LocalDB.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/envoy/client/data/LocalDB.java b/client/src/main/java/envoy/client/data/LocalDB.java index add6962..4d02a31 100644 --- a/client/src/main/java/envoy/client/data/LocalDB.java +++ b/client/src/main/java/envoy/client/data/LocalDB.java @@ -133,8 +133,9 @@ public final class LocalDB implements EventListener { chats = (List) in.readObject(); cacheMap = (CacheMap) in.readObject(); lastSync = (Instant) in.readObject(); + } finally { + synchronize(); } - synchronize(); } /** @@ -188,6 +189,12 @@ public final class LocalDB implements EventListener { } } + /** + * Stores a new authentication token. + * + * @param evt the event containing the authentication token + * @since Envoy Client v0.2-beta + */ @Event private void onNewAuthToken(NewAuthToken evt) { authToken = evt.get(); }