chore: more logging

This commit is contained in:
Adhiraj Singh
2022-07-24 11:46:55 +05:30
parent 54a3bae581
commit 9aa9006236

View File

@@ -35,12 +35,14 @@ export const makeChatsSocket = (config: SocketConfig) => {
const appStateSyncTimeout = debouncedTimeout(
APP_STATE_SYNC_TIMEOUT_MS,
async() => {
logger.info(
{ recvChats: Object.keys(recvChats).length },
'doing initial app state sync'
)
if(ws.readyState === ws.OPEN) {
logger.info(
{ recvChats: Object.keys(recvChats).length },
'doing initial app state sync'
)
await resyncMainAppState(recvChats)
} else {
logger.warn('connection closed before app state sync')
}
historyCache.clear()