From 6dd2b738553f56be8699bc81e9c0b77dc5e30540 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 1 Sep 2022 18:05:47 -0700 Subject: [PATCH] Storage/getItemsState: Warn if not ready, log on success as well --- ts/textsecure/Storage.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ts/textsecure/Storage.ts b/ts/textsecure/Storage.ts index 4470d44ba..28c7b0d27 100644 --- a/ts/textsecure/Storage.ts +++ b/ts/textsecure/Storage.ts @@ -122,6 +122,12 @@ export class Storage implements StorageInterface { } public getItemsState(): Partial { + if (!this.ready) { + log.warn('Called getItemsState before storage is ready'); + } + + log.info('Storage/getItemsState: now preparing copy of items...'); + const state = Object.create(null); // TypeScript isn't smart enough to figure out the types automatically.