diff --git a/BUILDING.md b/BUILDING.md index f205e7dc0..783e15e29 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -47,7 +47,7 @@ base64 -i certificate.p12 -o encoded.txt ### Node version -You will need node `10.13.0`. +You will need node `10.19.0`. This can be done by using [nvm](https://github.com/nvm-sh/nvm) and running `nvm use` or you can install it manually. ### Prerequisites diff --git a/package.json b/package.json index 880c40e22..45dcaebca 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.4", + "version": "1.5.5", "license": "GPL-3.0", "author": { "name": "Loki Project", @@ -212,7 +212,7 @@ "webpack": "4.4.1" }, "engines": { - "node": "^10.13.0" + "node": "^10.19.0" }, "build": { "appId": "com.loki-project.messenger-desktop", diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 2c1da5a20..e8f59ca44 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -6,7 +6,7 @@ import { SessionToastContainer } from './SessionToastContainer'; import { ConversationController } from '../../session/conversations'; import { UserUtils } from '../../session/utils'; import { syncConfigurationIfNeeded } from '../../session/utils/syncUtils'; -import { DAYS, MINUTES, SECONDS } from '../../session/utils/Number'; +import { DAYS, MINUTES } from '../../session/utils/Number'; import { generateAttachmentKeyIfEmpty, getItemById, @@ -32,6 +32,7 @@ import { showLeftPaneSection } from '../../state/ducks/section'; import { cleanUpOldDecryptedMedias } from '../../session/crypto/DecryptedAttachmentsManager'; import { OpenGroupManagerV2 } from '../../opengroup/opengroupV2/OpenGroupManagerV2'; import { loadDefaultRooms } from '../../opengroup/opengroupV2/ApiUtil'; +import { forceRefreshRandomSnodePool } from '../../session/snode_api/snodePool'; // tslint:disable-next-line: no-import-side-effect no-submodule-imports export enum SectionType { @@ -217,6 +218,10 @@ export const ActionsPanel = () => { void syncConfigurationIfNeeded(); }, DAYS * 2); + useInterval(() => { + void forceRefreshRandomSnodePool(); + }, DAYS * 1); + return (
diff --git a/ts/session/snode_api/onions.ts b/ts/session/snode_api/onions.ts index 7b1abeba2..5b264b48d 100644 --- a/ts/session/snode_api/onions.ts +++ b/ts/session/snode_api/onions.ts @@ -234,7 +234,11 @@ const processOnionResponse = async ( log.warn( `(${reqIdx}) [path] lokiRpc::processOnionResponse - fetch unhandled error code: ${response.status}: ${rsp}` ); - return RequestError.OTHER; + // FIXME audric + // this is pretty strong but on the current setup. + // we have to increase a snode invididually and only mark later the path as bad + // the way it works on mobile is that we treat a node as bad in that case, and if it then reaches a failure count of 3 or so we kick it out and rebuild the path + return RequestError.BAD_PATH; } let ciphertext = (await response.text()) as string; diff --git a/ts/session/snode_api/snodePool.ts b/ts/session/snode_api/snodePool.ts index 3fa406ca4..7216ad4fb 100644 --- a/ts/session/snode_api/snodePool.ts +++ b/ts/session/snode_api/snodePool.ts @@ -149,6 +149,16 @@ async function requestVersion(node: any): Promise { } } +/** + * This function force the snode poll to be refreshed from a random seed node again. + * This should be called once in a day or so for when the app it kept on. + */ +export async function forceRefreshRandomSnodePool(): Promise> { + await refreshRandomPool([]); + + return randomSnodePool; +} + export async function getRandomSnodePool(): Promise> { if (randomSnodePool.length === 0) { await refreshRandomPool([]);