From 55253125428f1cc72d86f833b7ffca265e2feb84 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 6 May 2021 15:59:53 +1000 Subject: [PATCH 1/3] syncConf every 7 days and fix link device --- js/background.js | 3 ++- preload.js | 1 + ts/session/utils/syncUtils.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 3631ae88f..5a8bb4606 100644 --- a/js/background.js +++ b/js/background.js @@ -756,8 +756,9 @@ messageReceiver.addEventListener('sent', window.DataMessageReceiver.handleMessageEvent); messageReceiver.addEventListener('reconnect', onReconnect); messageReceiver.addEventListener('configuration', onConfiguration); - // messageReceiver.addEventListener('typing', onTyping); + window.SwarmPolling.addPubkey(window.libsession.Utils.UserUtils.getOurPubKeyStrFromCache()); + window.SwarmPolling.start(); window.libsession.Utils.AttachmentDownloads.start({ logger: window.log, }); diff --git a/preload.js b/preload.js index ca15f6608..32cca1af0 100644 --- a/preload.js +++ b/preload.js @@ -328,6 +328,7 @@ window.LokiPublicChatAPI = require('./js/modules/loki_public_chat_api'); window.LokiFileServerAPI = require('./js/modules/loki_file_server_api'); window.LokiPushNotificationServerApi = require('./js/modules/loki_push_notification_server_api'); +window.SwarmPolling = require('./ts/session/snode_api/swarmPolling').SwarmPolling.getInstance(); const WorkerInterface = require('./js/modules/util_worker_interface'); diff --git a/ts/session/utils/syncUtils.ts b/ts/session/utils/syncUtils.ts index 144b36cd1..4bfbf7ec7 100644 --- a/ts/session/utils/syncUtils.ts +++ b/ts/session/utils/syncUtils.ts @@ -42,7 +42,7 @@ export const syncConfigurationIfNeeded = async () => { const now = Date.now(); // if the last sync was less than 2 days before, return early. - if (Math.abs(now - lastSyncedTimestamp) < DAYS * 2) { + if (Math.abs(now - lastSyncedTimestamp) < DAYS * 7) { return; } From bc4bee6270744c3d4408ef510cce657202bc874c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 6 May 2021 16:02:47 +1000 Subject: [PATCH 2/3] hide some logs --- ts/components/session/ActionsPanel.tsx | 4 ++-- ts/opengroup/opengroupV2/OpenGroupServerPoller.ts | 2 +- ts/receiver/closedGroups.ts | 2 +- ts/session/utils/Attachments.ts | 2 +- ts/session/utils/syncUtils.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 98d0cdde0..5ced06163 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -141,7 +141,7 @@ const setupTheme = (dispatch: Dispatch) => { }; // Do this only if we created a new Session ID, or if we already received the initial configuration message -const triggerSyncIfIfNeeded = async () => { +const triggerSyncIfNeeded = async () => { const didWeHandleAConfigurationMessageAlready = (await getItemById(hasSyncedInitialConfigurationItem))?.value || false; if (didWeHandleAConfigurationMessageAlready) { @@ -174,7 +174,7 @@ const doAppStartUp = (dispatch: Dispatch) => { void OpenGroupManagerV2.getInstance().startPolling(); // trigger a sync message if needed for our other devices - void triggerSyncIfIfNeeded(); + void triggerSyncIfNeeded(); void loadDefaultRooms(); diff --git a/ts/opengroup/opengroupV2/OpenGroupServerPoller.ts b/ts/opengroup/opengroupV2/OpenGroupServerPoller.ts index fb2a229c2..912671ea4 100644 --- a/ts/opengroup/opengroupV2/OpenGroupServerPoller.ts +++ b/ts/opengroup/opengroupV2/OpenGroupServerPoller.ts @@ -409,7 +409,7 @@ const handleCompactPollResults = async ( serverUrl: string, results: Array ) => { - console.warn('compoll res', results); + // console.warn('compoll res', results); await Promise.all( results.map(async res => { const convoId = getOpenGroupV2ConversationId(serverUrl, res.roomId); diff --git a/ts/receiver/closedGroups.ts b/ts/receiver/closedGroups.ts index 23dde05a4..2e146c304 100644 --- a/ts/receiver/closedGroups.ts +++ b/ts/receiver/closedGroups.ts @@ -643,7 +643,7 @@ function addMemberToZombies( if (isAlreadyZombie) { return false; } - console.warn('Marking user ', userToAdd.key, ' as a zombie'); + // console.warn('Marking user ', userToAdd.key, ' as a zombie'); convo.set('zombies', [...zombies, userToAdd.key]); return true; } diff --git a/ts/session/utils/Attachments.ts b/ts/session/utils/Attachments.ts index 28ce6a686..63a39301f 100644 --- a/ts/session/utils/Attachments.ts +++ b/ts/session/utils/Attachments.ts @@ -102,7 +102,7 @@ export class AttachmentUtils { pointer.id = uploadToV2Result.fileId; pointer.url = uploadToV2Result.fileUrl; } else { - console.warn('upload to file server v2 failed'); + window.log.warn('upload to file server v2 failed'); } } else { const result = isAvatar diff --git a/ts/session/utils/syncUtils.ts b/ts/session/utils/syncUtils.ts index 4bfbf7ec7..9d69a4181 100644 --- a/ts/session/utils/syncUtils.ts +++ b/ts/session/utils/syncUtils.ts @@ -195,7 +195,7 @@ export const getCurrentConfigurationMessage = async (convos: Array Date: Thu, 6 May 2021 16:03:43 +1000 Subject: [PATCH 3/3] bump to v1.5.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cc2474d16..26090fd53 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.5.5", + "version": "1.5.6", "license": "GPL-3.0", "author": { "name": "Loki Project",