pull/1160/head
Mikunj 4 years ago
parent e6139a5463
commit 3ea0689d2f

@ -2229,8 +2229,7 @@
},
"invalidHexId": {
"message": "Invalid Session ID or LNS Name",
"description":
"Error string shown when user types an invalid pubkey hex string"
"description": "Error string shown when user types an invalid pubkey hex string"
},
"invalidLnsFormat": {
"message": "Invalid LNS Name",

@ -124,21 +124,15 @@ describe('Add friends', function() {
);
await common.logsContains(
bobLogs,
`Received a NORMAL_FRIEND_REQUEST from source: ${
common.TEST_PUBKEY1
}, primarySource: ${common.TEST_PUBKEY1},`
`Received a NORMAL_FRIEND_REQUEST from source: ${common.TEST_PUBKEY1}, primarySource: ${common.TEST_PUBKEY1},`
);
await common.logsContains(
bobLogs,
`Sending incoming-friend-request-accept:onlineBroadcast message to ${
common.TEST_PUBKEY1
}`
`Sending incoming-friend-request-accept:onlineBroadcast message to ${common.TEST_PUBKEY1}`
);
await common.logsContains(
aliceLogs,
`Sending outgoing-friend-request-accepted:onlineBroadcast message to ${
common.TEST_PUBKEY2
}`
`Sending outgoing-friend-request-accepted:onlineBroadcast message to ${common.TEST_PUBKEY2}`
);
});
});

@ -52,9 +52,7 @@ describe('Link Device', function() {
// pairing request message sent from secondary to primary pubkey
await common.logsContains(
secondaryRenderLogs,
`Sending pairing-request:pairing-request message to ${
common.TEST_PUBKEY1
}`
`Sending pairing-request:pairing-request message to ${common.TEST_PUBKEY1}`
);
const primaryRenderLogs = await app.client.getRenderProcessLogs();

@ -98,16 +98,12 @@ describe('Message Syncing', function() {
);
await common.logsContains(
alice2Logs,
`Sending auto-friend-request:friend-request message to ${
common.TEST_PUBKEY2
}`,
`Sending auto-friend-request:friend-request message to ${common.TEST_PUBKEY2}`,
1
);
await common.logsContains(
alice2Logs,
`Sending session-request:friend-request message to ${
common.TEST_PUBKEY2
}`,
`Sending session-request:friend-request message to ${common.TEST_PUBKEY2}`,
1
);
await common.logsContains(

@ -1005,10 +1005,9 @@
// Search through each conversation (device) for friend request messages
const pendingRequestPromises = allConversationsWithUser.map(
async conversation => {
const request = (await conversation.getFriendRequests(
direction,
status
))[0];
const request = (
await conversation.getFriendRequests(direction, status)
)[0];
return { conversation, request };
}
);

@ -97,16 +97,12 @@ const sendViaOnion = async (srvPubKey, url, fetchOptions, options = {}) => {
pathNodes = await lokiSnodeAPI.getOnionPath();
} catch (e) {
log.error(
`loki_app_dot_net:::sendViaOnion #${
options.requestNumber
} - getOnionPath Error ${e.code} ${e.message}`
`loki_app_dot_net:::sendViaOnion #${options.requestNumber} - getOnionPath Error ${e.code} ${e.message}`
);
}
if (!pathNodes || !pathNodes.length) {
log.warn(
`loki_app_dot_net:::sendViaOnion #${
options.requestNumber
} - failing, no path available`
`loki_app_dot_net:::sendViaOnion #${options.requestNumber} - failing, no path available`
);
// should we retry?
return {};
@ -135,9 +131,7 @@ const sendViaOnion = async (srvPubKey, url, fetchOptions, options = {}) => {
// handle error/retries
if (!result.status) {
log.error(
`loki_app_dot_net:::sendViaOnion #${options.requestNumber} - Retry #${
options.retry
} Couldnt handle onion request, retrying`,
`loki_app_dot_net:::sendViaOnion #${options.requestNumber} - Retry #${options.retry} Couldnt handle onion request, retrying`,
payloadObj
);
return sendViaOnion(srvPubKey, url, fetchOptions, {
@ -155,9 +149,7 @@ const sendViaOnion = async (srvPubKey, url, fetchOptions, options = {}) => {
body = JSON.parse(result.body);
} catch (e) {
log.error(
`loki_app_dot_net:::sendViaOnion #${
options.requestNumber
} - Cant decode JSON body`,
`loki_app_dot_net:::sendViaOnion #${options.requestNumber} - Cant decode JSON body`,
result.body
);
}

@ -284,9 +284,7 @@ const processOnionResponse = async (
if (response.status !== 200) {
log.warn(
`(${reqIdx}) [path] lokiRpc::processOnionResponse - fetch unhandled error code: ${
response.status
}`
`(${reqIdx}) [path] lokiRpc::processOnionResponse - fetch unhandled error code: ${response.status}`
);
return false;
}

@ -115,9 +115,7 @@ async function tryGetSnodeListFromLokidSeednode(
}
if (snodes.length) {
log.info(
`loki_snodes:::tryGetSnodeListFromLokidSeednode - got ${
snodes.length
} service nodes from seed`
`loki_snodes:::tryGetSnodeListFromLokidSeednode - got ${snodes.length} service nodes from seed`
);
}
return snodes;
@ -277,18 +275,14 @@ class LokiSnodeAPI {
if (shuffled.length < DESIRED_GUARD_COUNT) {
log.error(
`Could not select guard nodes: node pool is not big enough, pool size ${
shuffled.length
}, need ${DESIRED_GUARD_COUNT}, attempting to refresh randomPool`
`Could not select guard nodes: node pool is not big enough, pool size ${shuffled.length}, need ${DESIRED_GUARD_COUNT}, attempting to refresh randomPool`
);
await this.refreshRandomPool();
nodePool = await this.getRandomSnodePool();
shuffled = _.shuffle(nodePool);
if (shuffled.length < DESIRED_GUARD_COUNT) {
log.error(
`Could not select guard nodes: node pool is not big enough, pool size ${
shuffled.length
}, need ${DESIRED_GUARD_COUNT}, failing...`
`Could not select guard nodes: node pool is not big enough, pool size ${shuffled.length}, need ${DESIRED_GUARD_COUNT}, failing...`
);
return [];
}

@ -167,8 +167,7 @@ function OutgoingMessage(
publicSendData,
debugMessageType,
autoSession,
} =
options || {};
} = options || {};
this.numberInfo = numberInfo;
this.isPublic = isPublic;
this.isMediumGroup = !!isMediumGroup;

@ -73,7 +73,7 @@ window.isBeforeVersion = (toCheck, baseVersion) => {
};
// eslint-disable-next-line func-names
window.CONSTANTS = new function() {
window.CONSTANTS = new (function() {
this.MAX_LOGIN_TRIES = 3;
this.MAX_PASSWORD_LENGTH = 64;
this.MAX_USERNAME_LENGTH = 20;
@ -96,7 +96,7 @@ window.CONSTANTS = new function() {
// https://loki.network/2020/03/25/loki-name-system-the-facts/
this.LNS_REGEX = `^[a-zA-Z0-9_]([a-zA-Z0-9_-]{0,${this.LNS_MAX_LENGTH -
2}}[a-zA-Z0-9_]){0,1}$`;
}();
})();
window.versionInfo = {
environment: window.getEnvironment(),

@ -249,27 +249,26 @@ export class SessionClosableOverlay extends React.Component<Props, State> {
/>
)}
{isClosedGroupView &&
window.lokiFeatureFlags.enableSenderKeys && (
<div className="sealed-sender-toggle">
<SessionToggle
active={Boolean(false)}
onClick={() => {
const value = this.state.senderKeys;
this.setState({ senderKeys: !value });
}}
/>
<span
className={classNames(
'session-settings-item__description',
'sender-keys-description'
)}
>
{window.i18n('useSenderKeys')}
</span>
</div>
)}
{isClosedGroupView && window.lokiFeatureFlags.enableSenderKeys && (
<div className="sealed-sender-toggle">
<SessionToggle
active={Boolean(false)}
onClick={() => {
const value = this.state.senderKeys;
this.setState({ senderKeys: !value });
}}
/>
<span
className={classNames(
'session-settings-item__description',
'sender-keys-description'
)}
>
{window.i18n('useSenderKeys')}
</span>
</div>
)}
<SessionButton
buttonColor={SessionButtonColor.Green}

Loading…
Cancel
Save