chore: more PR reviews

pull/3281/head
Audric Ackermann 10 months ago
parent 53cdcfbe35
commit 760aac3723
No known key found for this signature in database

@ -16,7 +16,7 @@ export const initialCallState: CallStateType = {
};
/**
* This slice is the one holding the default joinable rooms fetched once in a while from the default opengroup v2 server.
* This slice is the one holding the redux slice representing our current call state.
*/
const callSlice = createSlice({
name: 'call',

@ -395,7 +395,7 @@ const loadMetaDumpsFromDB = createAsyncThunk(
toReturn.push({ groupPk, infos, members });
} catch (e) {
// Note: Don't re trow here, we want to load everything we can
// Note: Don't rethrow here, we want to load everything we can
window.log.error(
`initGroup of Group wrapper of variant ${variant} failed with ${e.message} `
);
@ -1217,7 +1217,7 @@ function refreshConvosModelProps(convoIds: Array<string>) {
}
/**
* This slice is the one holding the default joinable rooms fetched once in a while from the default opengroup v2 server.
* This slice is representing the cached state of all our current 03-groups.
*/
const metaGroupSlice = createSlice({
name: 'metaGroup',

@ -11,7 +11,7 @@ export const initialOnionPathState = {
};
/**
* This slice is the one holding the default joinable rooms fetched once in a while from the default opengroup v2 server.
* This slice is the one holding our current onion path state, and if we are detect as online.
*/
const onionSlice = createSlice({
name: 'onionPaths',
@ -28,7 +28,6 @@ const onionSlice = createSlice({
},
});
// destructures
const { actions, reducer } = onionSlice;
export const { updateOnionPaths, updateIsOnline } = actions;
export const defaultOnionReducer = reducer;

@ -5,17 +5,6 @@ import { fromHexToArray } from '../../../../session/utils/String';
import { TestUtils } from '../../../test-utils';
describe('libsession_multi_encrypt', () => {
// let us: TestUserKeyPairs;
// let groupX25519SecretKey: Uint8Array;
beforeEach(async () => {
// us = await TestUtils.generateUserKeyPairs();
// const group = await TestUtils.generateGroupV2(us.ed25519KeyPair.privKeyBytes);
// if (!group.secretKey) {
// throw new Error('failed to create grou[p');
// }
// groupX25519SecretKey = group.secretKey;
});
afterEach(() => {
Sinon.restore();
});

@ -43,7 +43,7 @@ describe('UserSyncJob run()', () => {
});
it('throws if no user keys', async () => {
const job = new UserSync.UserSyncJob({});
// Note: the run() function should never throw, at most it should return "permanent failure"
const func = async () => job.run();
await expect(func()).to.be.eventually.rejected;
});
@ -53,7 +53,7 @@ describe('UserSyncJob run()', () => {
Sinon.stub(UserUtils, 'getOurPubKeyStrFromCache').returns({ something: false } as any);
Sinon.stub(UserUtils, 'getUserED25519KeyPairBytes').resolves({ something: true } as any);
Sinon.stub(ConvoHub.use(), 'get').resolves({}); // anything not falsy
// Note: the run() function should never throw, at most it should return "permanent failure"
const func = async () => job.run();
await expect(func()).to.be.eventually.rejected;
});
@ -298,7 +298,7 @@ describe('UserSyncJob pushChangesToUserSwarmIfNeeded', () => {
expect(dump.firstCall.args).to.be.deep.eq(['ContactsConfig']);
});
it('calls sendEncryptedDataToSnode with the right data x3 and retry if network returned nothing then success', async () => {
it('calls sendEncryptedDataToSnode with the right data x2 and retry if network returned nothing then success', async () => {
const profile = userChange(sodium, SnodeNamespaces.UserProfile, 321);
const contact = userChange(sodium, SnodeNamespaces.UserContacts, 123);
const groups = userChange(sodium, SnodeNamespaces.UserGroups, 111);

Loading…
Cancel
Save