Merge branch 'master' into open-group-v2

pull/1576/head
Audric Ackermann 4 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
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

@ -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",

@ -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 (
<div className="module-left-pane__sections-container">
<Section type={SectionType.Profile} avatarPath={ourPrimaryConversation.avatarPath} />

@ -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;

@ -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>> {
if (randomSnodePool.length === 0) {
await refreshRandomPool([]);

Loading…
Cancel
Save