Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos via codespell #2677

Merged
merged 1 commit into from Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILDING.md
Expand Up @@ -65,7 +65,7 @@ git lfs install
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
Expand Down Expand Up @@ -115,7 +115,7 @@ git lfs install # once git lfs is installed, you have to run this command too
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -102,7 +102,7 @@ For example, running:
NODE_APP_INSTANCE=alice yarn start-prod
```

Will run the development environment with the `alice` instance and thus create a seperate storage profile.
Will run the development environment with the `alice` instance and thus create a separate storage profile.

If a fixed profile is needed (in the case of tests), you can specify it using `storageProfile` in the config file. If the change is local then put it in `local-{instance}.json` otherwise put it in `default-{instance}.json` or `{env}-{instance}.json`.

Expand Down
2 changes: 1 addition & 1 deletion ts/components/SessionInboxView.tsx
Expand Up @@ -32,7 +32,7 @@ import { ExpirationTimerOptions } from '../util/expiringMessages';
import moment from 'moment';
import styled from 'styled-components';

// Default to the locale from env. It will be overriden if moment
// Default to the locale from env. It will be overridden if moment
// does not recognize it with what moment knows which is the closest.
// i.e. es-419 will return 'es'.
// We just need to use what we got from moment in getLocale on the updateLocale below
Expand Down
Expand Up @@ -17,7 +17,7 @@ const sha512FromPubkey = async (pubkey: string): Promise<string> => {
.join('');
};

// do not do this on every avatar, just cache the values so we can reuse them accross the app
// do not do this on every avatar, just cache the values so we can reuse them across the app
// key is the pubkey, value is the hash
const cachedHashes = new Map<string, number>();

Expand Down
2 changes: 1 addition & 1 deletion ts/components/basic/SessionDropdown.tsx
Expand Up @@ -3,7 +3,7 @@ import { SessionIcon, SessionIconType } from '../icon';

import { SessionDropdownItem, SessionDropDownItemType } from './SessionDropdownItem';

// THIS IS DROPDOWN ACCORDIAN STYLE OPTIONS SELECTOR ELEMENT, NOT A CONTEXTMENU
// THIS IS DROPDOWN ACCORDION STYLE OPTIONS SELECTOR ELEMENT, NOT A CONTEXTMENU

type Props = {
label: string;
Expand Down
2 changes: 1 addition & 1 deletion ts/components/basic/SessionInput.tsx
Expand Up @@ -92,7 +92,7 @@ export const SessionInput = (props: Props) => {
data-testid={inputDataTestId}
onChange={updateInputValue}
className={classNames(enableShowHide ? 'session-input-floating-label-show-hide' : '')}
// just incase onChange isn't triggered
// just in case onChange isn't triggered
onBlur={updateInputValue}
onKeyPress={event => {
if (event.key === 'Enter' && props.onEnterPressed) {
Expand Down
2 changes: 1 addition & 1 deletion ts/components/conversation/composition/CompositionBox.tsx
Expand Up @@ -707,7 +707,7 @@ class CompositionBoxInner extends React.Component<Props, State> {
// than the message was sent without the link preview.
// So be sure to reset the staged link preview so it is not sent with the next message.

// if we were not aborted, it's probably just an error on the fetch. Nothing to do excpet mark the fetch as done (with errors)
// if we were not aborted, it's probably just an error on the fetch. Nothing to do except mark the fetch as done (with errors)

if (aborted) {
this.setState({
Expand Down
Expand Up @@ -12,7 +12,7 @@ export const MINIMUM_LINK_PREVIEW_IMAGE_WIDTH = THUMBNAIL_SIDE;

type Props = {
messageId: string;
isDetailView?: boolean; // when the detail is shown for a message, we disble click and some other stuff
isDetailView?: boolean; // when the detail is shown for a message, we disable click and some other stuff
};

export const Message = (props: Props) => {
Expand Down
2 changes: 1 addition & 1 deletion ts/components/search/MessageSearchResults.tsx
Expand Up @@ -22,7 +22,7 @@ const StyledConversationTitleResults = styled.div`
white-space: nowrap;
text-overflow: ellipsis;
color: var(--conversation-tab-text-color);
/* We don't want this to overflow horziontally past the timestamp */
/* We don't want this to overflow horizontally past the timestamp */
width: 90px;
`;

Expand Down
2 changes: 1 addition & 1 deletion ts/interactions/conversations/unsendingInteractions.ts
Expand Up @@ -351,7 +351,7 @@ export async function deleteMessagesByIdForEveryone(
onClickOk: async () => {
await doDeleteSelectedMessages({ selectedMessages, conversation, deleteForEveryone: true });

// explicity close modal for this case.
// explicitly close modal for this case.
window.inboxStore?.dispatch(updateConfirmModal(null));
return;
},
Expand Down
2 changes: 1 addition & 1 deletion ts/mains/main_node.ts
Expand Up @@ -649,7 +649,7 @@ async function showDebugLogWindow() {
}

if (!mainWindow) {
console.info('debug log neeeds mainwindow size to open');
console.info('debug log needs mainwindow size to open');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion ts/node/config.ts
Expand Up @@ -24,7 +24,7 @@ if (environment === 'production') {
process.env.ALLOW_CONFIG_MUTATIONS = '';
process.env.SUPPRESS_NO_CONFIG_WARNING = '';

// We could be running againt production but still be in dev mode, we need to handle that
// We could be running against production but still be in dev mode, we need to handle that
if (!electronIsDev) {
process.env.NODE_APP_INSTANCE = '';
}
Expand Down
2 changes: 1 addition & 1 deletion ts/node/config/user_config.ts
Expand Up @@ -15,7 +15,7 @@ const { NODE_ENV: environment, NODE_APP_INSTANCE: instance } = process.env;
const isValidInstance = typeof instance === 'string' && instance.length > 0;
const isProduction = environment === 'production' && !isValidInstance;

// Use seperate data directories for each different environment and app instances
// Use separate data directories for each different environment and app instances
if (!isProduction) {
storageProfile = environment;
if (isValidInstance) {
Expand Down
2 changes: 1 addition & 1 deletion ts/node/migration/sessionMigrations.ts
Expand Up @@ -598,7 +598,7 @@ function updateToSessionSchemaVersion20(currentVersion: number, db: BetterSqlite

// obj.profile.displayName is the display as this user set it.
if (obj?.nickname?.length && obj?.profile?.displayName?.length) {
// this one has a nickname set, but name is unset, set it to the displayName in the lokiProfile if it's exisitng
// this one has a nickname set, but name is unset, set it to the displayName in the lokiProfile if it's existing
obj.name = obj.profile.displayName;
sqlNode.saveConversation(obj as ConversationAttributes, db);
}
Expand Down
2 changes: 1 addition & 1 deletion ts/node/sql.ts
Expand Up @@ -2147,7 +2147,7 @@ function cleanUpOldOpengroupsOnStart() {
let pruneSetting = getItemById(SettingsKey.settingsOpengroupPruning)?.value;

if (pruneSetting === undefined) {
console.info('Prune settings is undefined (and not explicitely false), forcing it to true.');
console.info('Prune settings is undefined (and not explicitly false), forcing it to true.');
createOrUpdateItem({ id: SettingsKey.settingsOpengroupPruning, value: true });
pruneSetting = true;
}
Expand Down
2 changes: 1 addition & 1 deletion ts/receiver/configMessage.ts
Expand Up @@ -174,7 +174,7 @@ const handleContactFromConfig = async (
}
}

// only set for explicit true/false values incase outdated sender doesn't have the fields
// only set for explicit true/false values in case outdated sender doesn't have the fields
if (contactReceived.isBlocked === true) {
if (contactConvo.isIncomingRequest()) {
// handling case where restored device's declined message requests were getting restored
Expand Down
4 changes: 2 additions & 2 deletions ts/receiver/queuedJob.ts
Expand Up @@ -391,7 +391,7 @@ export async function handleMessageJob(
void queueAttachmentDownloads(messageModel, conversation);
// Check if we need to update any profile names
// the only profile we don't update with what is coming here is ours,
// as our profile is shared accross our devices with a ConfigurationMessage
// as our profile is shared across our devices with a ConfigurationMessage
if (messageModel.isIncoming() && regularDataMessage.profile) {
void appendFetchAvatarAndProfileJob(
sendingDeviceConversation,
Expand All @@ -400,7 +400,7 @@ export async function handleMessageJob(
);
}

// even with all the warnings, I am very sus about if this is usefull or not
// even with all the warnings, I am very sus about if this is useful or not
// try {
// // We go to the database here because, between the message save above and
// // the previous line's trigger() call, we might have marked all messages
Expand Down
Expand Up @@ -22,7 +22,7 @@ export type OpenGroupRequestHeaders = {
* @param endpoint endpoint of request we're making
* @param method method of request we're making
* @param blinded is the server being requested to blinded or not
* @param body the body of the request we're mkaing
* @param body the body of the request we're making
* @returns object of headers, including X-SOGS and other headers.
*/
const getOurOpenGroupHeaders = async (
Expand Down
2 changes: 1 addition & 1 deletion ts/session/apis/open_group_api/sogsv3/sogsV3BatchPoll.ts
Expand Up @@ -330,7 +330,7 @@ const makeBatchRequestPayload = (
};

/**
* Get the request to get all of the details we care from an opengroup, accross all rooms.
* Get the request to get all of the details we care from an opengroup, across all rooms.
* Only compatible with v4 onion requests.
*
* if isSequence is set to true, each rows will be run in order until the first one fails
Expand Down
2 changes: 1 addition & 1 deletion ts/session/apis/snode_api/SNodeAPI.ts
Expand Up @@ -567,7 +567,7 @@ export async function retrieveNextMessages(
}

/**
* Makes a post to a node to receive the timestamp info. If non-existant, returns -1
* Makes a post to a node to receive the timestamp info. If non-existent, returns -1
* @param snode Snode to send request to
* @returns timestamp of the response from snode
*/
Expand Down
2 changes: 1 addition & 1 deletion ts/session/apis/snode_api/onions.ts
Expand Up @@ -727,7 +727,7 @@ async function handle421InvalidSwarm({
associatedWith,
});

// this is important we throw so another retry is made and we exit the handling of that reponse
// this is important we throw so another retry is made and we exit the handling of that response
throw new pRetry.AbortError(ERROR_421_HANDLED_RETRY_REQUEST);
}

Expand Down
4 changes: 2 additions & 2 deletions ts/session/onions/onionPath.ts
Expand Up @@ -260,7 +260,7 @@ async function dropPathStartingWithGuardNode(guardNodeEd25519: string) {
guardNodes = guardNodes.filter(g => g.pubkey_ed25519 !== guardNodeEd25519);
// write the updates guard nodes to the db.
await internalUpdateGuardNodes(guardNodes);
// we are dropping it. Reset the counter in case this same guard gets choosen later
// we are dropping it. Reset the counter in case this same guard gets chosen later
pathFailureCount[guardNodeEd25519] = 0;

// trigger path rebuilding for the dropped path. This will throw if anything happens
Expand Down Expand Up @@ -516,7 +516,7 @@ async function buildNewOnionPathsWorker() {
minTimeout: 1000,
onFailedAttempt: e => {
window?.log?.warn(
`buildNewOnionPathsWorker attemp #${e.attemptNumber} failed. ${e.retriesLeft} retries left... Error: ${e.message}`
`buildNewOnionPathsWorker attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left... Error: ${e.message}`
);
},
}
Expand Down
2 changes: 1 addition & 1 deletion ts/session/sending/MessageSentHandler.ts
Expand Up @@ -175,7 +175,7 @@ async function handleMessageSentFailure(
/**
* This function tries to find a message by messageId by first looking on the MessageController.
* The MessageController holds all messages being in memory.
* Those are the messages sent recently, recieved recently, or the one shown to the user.
* Those are the messages sent recently, received recently, or the one shown to the user.
*
* If the app restarted, it's very likely those messages won't be on the memory anymore.
* In this case, this function will look for it in the database and return it.
Expand Down
2 changes: 1 addition & 1 deletion ts/session/utils/AttachmentsDownload.ts
Expand Up @@ -236,7 +236,7 @@ async function _runJob(job: any) {
// so there is no need to continue trying to download it.
if (currentAttempt >= 3 || was404Error(error)) {
logger.error(
`_runJob: ${currentAttempt} failed attempts, marking attachment ${id} from message ${found?.idForLogging()} as permament error:`,
`_runJob: ${currentAttempt} failed attempts, marking attachment ${id} from message ${found?.idForLogging()} as permanent error:`,
error && error.stack ? error.stack : error
);

Expand Down
2 changes: 1 addition & 1 deletion ts/session/utils/Promise.ts
Expand Up @@ -166,7 +166,7 @@ export async function poll(
}

/**
* Creates a promise which waits until `check` returns `true` or rejects if `timeout` preiod is reached.
* Creates a promise which waits until `check` returns `true` or rejects if `timeout` period is reached.
* If `timeout` is reached then this will throw an Error.
*
* @param check The boolean check.
Expand Down
2 changes: 1 addition & 1 deletion ts/session/utils/SodiumUtils.ts
Expand Up @@ -26,7 +26,7 @@ export function combineKeys(
//
// BLAKE2b(a kB || kA || kB)
//
// The receiver can calulate the same value via:
// The receiver can calculate the same value via:
//
// BLAKE2b(b kA || kA || kB)
export function sharedBlindedEncryptionKey({
Expand Down
6 changes: 3 additions & 3 deletions ts/session/utils/calling/CallManager.ts
Expand Up @@ -509,7 +509,7 @@ export async function USER_callRecipient(recipient: string) {
callNotificationType: 'started-call',
});

// initiating a call is analgous to sending a message request
// initiating a call is analogous to sending a message request
await approveConvoAndSendResponse(recipient, true);

// we do it manually as the sendToPubkeyNonDurably rely on having a message saved to the db for MessageSentSuccess
Expand All @@ -521,7 +521,7 @@ export async function USER_callRecipient(recipient: string) {
await openMediaDevicesAndAddTracks();
await createOfferAndSendIt(recipient);

// close and end the call if callTimeoutMs is reached ans still not connected
// close and end the call if callTimeoutMs is reached and still not connected
global.setTimeout(async () => {
if (justCreatedCallUUID === currentCallUUID && getIsRinging()) {
window.log.info(
Expand Down Expand Up @@ -751,7 +751,7 @@ function createOrGetPeerConnection(withPubkey: string) {
);

if (peerConnection && peerConnection?.iceConnectionState === 'disconnected') {
//this will trigger a negotation event with iceRestart set to true in the createOffer options set
//this will trigger a negotiation event with iceRestart set to true in the createOffer options set
global.setTimeout(async () => {
window.log.info('onconnectionstatechange disconnected: restartIce()');

Expand Down
4 changes: 2 additions & 2 deletions ts/state/ducks/conversations.ts
Expand Up @@ -301,7 +301,7 @@ export type ConversationsStateType = {
* Saving it here, make it possible to restore the position of the user before the refresh by pointing
* at that same messageId and aligning the list to the top.
*
* Once the view scrolled, this value is reseted by resetOldTopMessageId
* Once the view scrolled, this value is reset by resetOldTopMessageId
*/

oldTopMessageId: string | null;
Expand All @@ -310,7 +310,7 @@ export type ConversationsStateType = {
* Saving it here, make it possible to restore the position of the user before the refresh by pointing
* at that same messageId and aligning the list to the bottom.
*
* Once the view scrolled, this value is reseted by resetOldBottomMessageId
* Once the view scrolled, this value is reset by resetOldBottomMessageId
*/
oldBottomMessageId: string | null;

Expand Down
Expand Up @@ -467,7 +467,7 @@ const decryptBlindedMessage = async (

if (plaintextIncoming.length <= 32) {
// throw Error;
window?.log?.error('decryptBlindedMessage: plaintext unsufficient length');
window?.log?.error('decryptBlindedMessage: plaintext insufficient length');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion ts/test/session/unit/onion/OnionErrors_test.ts
Expand Up @@ -94,7 +94,7 @@ describe('OnionPathsErrors', () => {
stubData('getSwarmNodesForPubkey').resolves(fakeSwarmForAssociatedWith);
updateGuardNodesStub = stubData('updateGuardNodes').resolves();

// those are still doing what they do, but we spy on their executation
// those are still doing what they do, but we spy on their execution
updateSwarmSpy = stubData('updateSwarmNodesForPubkey').resolves();
stubData('getItemById').resolves({ id: SNODE_POOL_ITEM_ID, value: '' });
stubData('createOrUpdateItem').resolves();
Expand Down
2 changes: 1 addition & 1 deletion ts/test/session/unit/padding/Padding_test.ts
Expand Up @@ -53,7 +53,7 @@ describe('Padding', () => {
});

it('add padding if the attachment is already too big', () => {
// we just want to make sure we do not overide attachment data. The file upload will fail, but at least make sure to keep the user data.
// we just want to make sure we do not override attachment data. The file upload will fail, but at least make sure to keep the user data.
const bufferIn = new Uint8Array(MAX_ATTACHMENT_FILESIZE_BYTES + 1);
const paddedBuffer = addAttachmentPadding(bufferIn);
const expectedPaddedSize = Math.floor(
Expand Down
2 changes: 1 addition & 1 deletion ts/test/session/unit/sending/MessageSender_test.ts
Expand Up @@ -145,7 +145,7 @@ describe('MessageSender', () => {
expect(decodedTimestampFromSending).to.be.above(expectedTimestamp - 10);
expect(decodedTimestampFromSending).to.be.below(expectedTimestamp + 10);

// then make sure the plaintextBuffer was overriden too
// then make sure the plaintextBuffer was overridden too
const visibleMessageExpected = TestUtils.generateVisibleMessage({
timestamp: decodedTimestampFromSending,
});
Expand Down
4 changes: 2 additions & 2 deletions ts/test/session/unit/sogsv3/MutationCache_test.ts
Expand Up @@ -311,7 +311,7 @@ describe('mutationCache', () => {
server: roomInfos.serverUrl,
room: roomInfos.roomId,
changeType: ChangeType.REACTIONS,
seqno: 300, // greater than response messageResponse seqno should be procesed
seqno: 300, // greater than response messageResponse seqno should be processed
metadata: {
messageId: originalMessage.serverId,
emoji: '😄',
Expand All @@ -322,7 +322,7 @@ describe('mutationCache', () => {
server: roomInfos.serverUrl,
room: roomInfos.roomId,
changeType: ChangeType.REACTIONS,
seqno: 301, //// greater than response messageResponse seqno should be procesed
seqno: 301, //// greater than response messageResponse seqno should be processed
metadata: {
messageId: originalMessage.serverId,
emoji: '😈',
Expand Down
4 changes: 2 additions & 2 deletions ts/test/session/unit/sogsv3/knownBlindedKeys_test.ts
Expand Up @@ -95,13 +95,13 @@ describe('knownBlindedKeys', () => {

describe('writeKnownBlindedKeys', () => {
it('writeKnownBlindedKeys with null', async () => {
// the cached blinded keys is resetted on each test, so that first one we try to write null
// the cached blinded keys is reset on each test, so that first one we try to write null
await writeKnownBlindedKeys();
expect(createOrUpdateItem.notCalled).to.be.true;
});

it('writeKnownBlindedKeys with null but loaded', async () => {
// the cached blinded keys is resetted on each test, so that first one we try to write null
// the cached blinded keys is reset on each test, so that first one we try to write null

getItemById.resolves(null);
await loadKnownBlindedKeys();
Expand Down
2 changes: 1 addition & 1 deletion ts/test/session/unit/utils/JobQueue_test.ts
Expand Up @@ -42,7 +42,7 @@ describe('JobQueue', () => {
const start = Date.now();
await assert.eventually.deepEqual(Promise.all(input.map(mapper)), [10, 20, 30]);
const timeTaken = Date.now() - start;
assert.isAtLeast(timeTaken, 20, 'Queue should take atleast 100ms to run.');
assert.isAtLeast(timeTaken, 20, 'Queue should take at least 100ms to run.');
});

it('should return the result of the job', async () => {
Expand Down
2 changes: 1 addition & 1 deletion ts/themes/globals.tsx
@@ -1,7 +1,7 @@
import { hexColorToRGB } from '../util/hexColorToRGB';
import { COLORS } from './constants/colors';

// These variables are independant of the current theme
// These variables are independent of the current theme
export type ThemeGlobals = {
/* Fonts */
'--font-default': string;
Expand Down