Merge branch 'master' into open-group-v2

pull/1576/head
Audric Ackermann 5 years ago
commit 66d5fd93e2
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -47,7 +47,7 @@ base64 -i certificate.p12 -o encoded.txt
### Node version ### 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. This can be done by using [nvm](https://github.com/nvm-sh/nvm) and running `nvm use` or you can install it manually.
### Prerequisites ### Prerequisites

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.5.4", "version": "1.5.5",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Loki Project", "name": "Loki Project",
@ -212,7 +212,7 @@
"webpack": "4.4.1" "webpack": "4.4.1"
}, },
"engines": { "engines": {
"node": "^10.13.0" "node": "^10.19.0"
}, },
"build": { "build": {
"appId": "com.loki-project.messenger-desktop", "appId": "com.loki-project.messenger-desktop",

@ -6,7 +6,7 @@ import { SessionToastContainer } from './SessionToastContainer';
import { ConversationController } from '../../session/conversations'; import { ConversationController } from '../../session/conversations';
import { UserUtils } from '../../session/utils'; import { UserUtils } from '../../session/utils';
import { syncConfigurationIfNeeded } from '../../session/utils/syncUtils'; import { syncConfigurationIfNeeded } from '../../session/utils/syncUtils';
import { DAYS, MINUTES, SECONDS } from '../../session/utils/Number'; import { DAYS, MINUTES } from '../../session/utils/Number';
import { import {
generateAttachmentKeyIfEmpty, generateAttachmentKeyIfEmpty,
getItemById, getItemById,
@ -32,6 +32,7 @@ import { showLeftPaneSection } from '../../state/ducks/section';
import { cleanUpOldDecryptedMedias } from '../../session/crypto/DecryptedAttachmentsManager'; import { cleanUpOldDecryptedMedias } from '../../session/crypto/DecryptedAttachmentsManager';
import { OpenGroupManagerV2 } from '../../opengroup/opengroupV2/OpenGroupManagerV2'; import { OpenGroupManagerV2 } from '../../opengroup/opengroupV2/OpenGroupManagerV2';
import { loadDefaultRooms } from '../../opengroup/opengroupV2/ApiUtil'; import { loadDefaultRooms } from '../../opengroup/opengroupV2/ApiUtil';
import { forceRefreshRandomSnodePool } from '../../session/snode_api/snodePool';
// tslint:disable-next-line: no-import-side-effect no-submodule-imports // tslint:disable-next-line: no-import-side-effect no-submodule-imports
export enum SectionType { export enum SectionType {
@ -217,6 +218,10 @@ export const ActionsPanel = () => {
void syncConfigurationIfNeeded(); void syncConfigurationIfNeeded();
}, DAYS * 2); }, DAYS * 2);
useInterval(() => {
void forceRefreshRandomSnodePool();
}, DAYS * 1);
return ( return (
<div className="module-left-pane__sections-container"> <div className="module-left-pane__sections-container">
<Section type={SectionType.Profile} avatarPath={ourPrimaryConversation.avatarPath} /> <Section type={SectionType.Profile} avatarPath={ourPrimaryConversation.avatarPath} />

@ -234,7 +234,11 @@ const processOnionResponse = async (
log.warn( log.warn(
`(${reqIdx}) [path] lokiRpc::processOnionResponse - fetch unhandled error code: ${response.status}: ${rsp}` `(${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; let ciphertext = (await response.text()) as string;

@ -149,6 +149,16 @@ async function requestVersion(node: any): Promise<void> {
} }
} }
/**
* 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<Array<Snode>> {
await refreshRandomPool([]);
return randomSnodePool;
}
export async function getRandomSnodePool(): Promise<Array<Snode>> { export async function getRandomSnodePool(): Promise<Array<Snode>> {
if (randomSnodePool.length === 0) { if (randomSnodePool.length === 0) {
await refreshRandomPool([]); await refreshRandomPool([]);

Loading…
Cancel
Save