Skip to content

Commit

Permalink
chore: fix typo and update session foundation contact
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Nov 26, 2024
1 parent cd49729 commit 1f05105
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 42 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"version": "1.15.0",
"license": "GPL-3.0",
"author": {
"name": "Oxen Labs",
"email": "team@oxen.io"
"name": "Session Foundation",
"email": "contact@session.foundation"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions ts/receiver/dataMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ function cleanAttachments(decryptedDataMessage: SignalService.DataMessage) {

// Here we go from binary to string/base64 in all AttachmentPointer digest/key fields

// we do not care about group on Session Desktop

// we do not care about the group field on Session Desktop
decryptedDataMessage.group = null;

// when receiving a message we get keys of attachment as buffer, but we override the data with the decrypted string instead.
Expand Down
2 changes: 1 addition & 1 deletion ts/receiver/receiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function handleRequestDetail(
envelope.messageHash = messageHash;

try {
// NOTE: Annoyngly we add plaintext to the cache
// NOTE: Annoyingly we add plaintext to the cache
// after we've already processed some of it (thus the
// need to handle senderIdentity separately)...
perfStart(`addToCache-${envelope.id}`);
Expand Down
34 changes: 0 additions & 34 deletions ts/session/apis/snode_api/getNetworkTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,8 @@

import { isNumber } from 'lodash';

import { BatchRequests } from './batchRequest';
import { Snode } from '../../../data/types';
import { NetworkTimeSubRequest } from './SnodeRequestTypes';
import { NetworkTime } from '../../../util/NetworkTime';

const getNetworkTime = async (snode: Snode): Promise<string | number> => {
const subRequest = new NetworkTimeSubRequest();

const result = await BatchRequests.doUnsignedSnodeBatchRequestNoRetries(
[subRequest],
snode,
10000,
null,
false
);
if (!result || !result.length) {
window?.log?.warn(`getNetworkTime on ${snode.ip}:${snode.port} returned falsy value`, result);
throw new Error('getNetworkTime: Invalid result');
}

const firstResult = result[0];

if (firstResult.code !== 200) {
window?.log?.warn('Status is not 200 for getNetworkTime but: ', firstResult.code);
throw new Error('getNetworkTime: Invalid status code');
}

const timestamp = firstResult?.body?.timestamp;
if (!timestamp) {
throw new Error(`getNetworkTime returned invalid timestamp: ${timestamp}`);
}
GetNetworkTime.handleTimestampOffsetFromNetwork('getNetworkTime', timestamp);
return timestamp;
};

function handleTimestampOffsetFromNetwork(_request: string, snodeTimestamp: number) {
if (snodeTimestamp && isNumber(snodeTimestamp) && snodeTimestamp > 1609419600 * 1000) {
// first january 2021. Arbitrary, just want to make sure the return timestamp is somehow valid and not some crazy low value
Expand All @@ -50,6 +17,5 @@ function handleTimestampOffsetFromNetwork(_request: string, snodeTimestamp: numb
}

export const GetNetworkTime = {
getNetworkTime,
handleTimestampOffsetFromNetwork,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

/**
* Try to decrypt the content with any type of encryption domains we know.
* Does not throw, will return null if we couldn't decrypt it successfuly.
* Does not throw, will return null if we couldn't decrypt it successfully.
*/
async function multiDecryptAnyEncryptionDomain({
encoded,
Expand Down
2 changes: 1 addition & 1 deletion ts/state/onboarding/ducks/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export enum AccountRestoration {
Finished,
/** we failed to fetch account details in time, so we enter it manually */
DisplayName,
/** we have restored successfuly, show the conversation screen */
/** we have restored successfully, show the conversation screen */
Complete,
}

Expand Down
2 changes: 1 addition & 1 deletion ts/test/session/unit/sending/PendingMessageCache_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ describe('PendingMessageCache', () => {
Buffer.compare(message.plainTextBuffer, addedMessage.plainTextBuffer) === 0;
expect(buffersCompare).to.equal(true, 'buffers were not loaded properly from database');

// Compare all other valures
// Compare all other values
const trimmedAdded = _.omit(addedMessage, ['plainTextBuffer', 'plainTextBufferHex']);
const trimmedRebuilt = _.omit(message, ['plainTextBuffer', 'plainTextBufferHex']);

Expand Down

0 comments on commit 1f05105

Please sign in to comment.