chore: more details to requests constructors so we can share more

between wasm/swarm explorer/etc
pull/3281/head
Audric Ackermann 4 months ago
parent 7f1dab1836
commit 2ef48f5526
No known key found for this signature in database

@ -124,7 +124,9 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => {
})
: null}
</Flex>
<StyledTitle className="session-modal__header__title" data-testid='modal-heading'>{title}</StyledTitle>
<StyledTitle className="session-modal__header__title" data-testid="modal-heading">
{title}
</StyledTitle>
<Flex
container={true}
flexDirection={headerReverse ? 'row-reverse' : 'row'}

@ -42,8 +42,7 @@ export const InteractionNotification = (props: PropsForInteractionNotification)
switch (interactionType) {
case ConversationInteractionType.Hide:
// this can't happen
break;
return null;
case ConversationInteractionType.Leave:
text = isCommunity
? window.i18n('communityLeaveError', {

@ -65,7 +65,7 @@ export const InteractionItem = (props: InteractionItemProps) => {
switch (interactionType) {
case ConversationInteractionType.Hide:
// if it's hidden or pending hiding, we don't show any text
break;
return null;
case ConversationInteractionType.Leave:
errorText = isCommunity
? window.i18n('communityLeaveError', {

@ -344,11 +344,8 @@ export function showDeletePrivateConversationByConvoId(conversationId: string) {
const onClickOk = async () => {
try {
await updateConversationInteractionState({
conversationId,
type: isMe ? ConversationInteractionType.Hide : ConversationInteractionType.Leave,
status: ConversationInteractionStatus.Start,
});
// no network calls are made when we hide/delete a private chat, so no need to have a
// ConversationInteractionType state
onClickClose();
await ConvoHub.use().delete1o1(conversationId, {
fromSyncMessage: false,
@ -358,12 +355,6 @@ export function showDeletePrivateConversationByConvoId(conversationId: string) {
await clearConversationInteractionState({ conversationId });
} catch (err) {
window.log.warn(`showDeletePrivateConversationByConvoId error: ${err}`);
await saveConversationInteractionErrorAsMessage({
conversationId,
interactionType: isMe
? ConversationInteractionType.Hide
: ConversationInteractionType.Leave,
});
}
};

@ -0,0 +1,8 @@
import { NonEmptyArray } from '../../types/utility';
export type BatchResultEntry = {
code: number;
body: Record<string, any>;
};
export type NotEmptyArrayOfBatchResults = NonEmptyArray<BatchResultEntry>;

@ -17,18 +17,18 @@ import {
} from './namespaces';
import { GroupDetailsNeededForSignature, SnodeGroupSignature } from './signature/groupSignature';
import { SnodeSignature } from './signature/snodeSignatures';
import { ShortenOrExtend, WithMessagesHashes, WithShortenOrExtend } from './types';
import { TTL_DEFAULT } from '../../constants';
import { NetworkTime } from '../../../util/NetworkTime';
import {
WithMessagesHashes,
ShortenOrExtend,
WithShortenOrExtend,
WithCreatedAtNetworkTimestamp,
WithMaxSize,
WithMethod,
WithSecretKey,
WithSignature,
WithTimestamp,
WithGetNow,
} from '../../types/with';
import { NonEmptyArray } from '../../types/utility';
/**
* This is the base sub request class that every other type of request has to extend.
@ -38,6 +38,11 @@ abstract class SnodeAPISubRequest<T extends string> {
public abstract loggingId(): string;
public abstract getDestination(): PubkeyType | GroupPubkeyType | '<none>';
public abstract build(): Promise<Record<string, unknown>>;
public async toBody() {
return JSON.stringify(await this.build());
}
constructor({ method }: WithMethod<T>) {
this.method = method;
@ -89,8 +94,11 @@ abstract class ExpireSubRequest extends SnodeAPISubRequest<'expire'> {
}
abstract class StoreSubRequest extends SnodeAPISubRequest<'store'> {
constructor() {
public readonly getNow: () => number;
constructor(args: WithGetNow) {
super({ method: 'store' });
this.getNow = args.getNow;
}
}
@ -110,7 +118,7 @@ export class RetrieveLegacyClosedGroupSubRequest extends RetrieveSubRequest {
this.legacyGroupPk = legacyGroupPk;
}
public build() {
public async build() {
return {
method: this.method,
params: {
@ -172,7 +180,6 @@ export class RetrieveUserSubRequest extends RetrieveSubRequest {
namespace: SnodeNamespacesUser | SnodeNamespacesUserConfig;
}) {
super({ last_hash, max_size });
this.namespace = namespace;
}
@ -280,7 +287,7 @@ export class OnsResolveSubRequest extends OxendSubRequest {
this.base64EncodedNameHash = base64EncodedNameHash;
}
public build() {
public async build() {
return {
method: this.method,
params: {
@ -303,7 +310,7 @@ export class OnsResolveSubRequest extends OxendSubRequest {
}
export class GetServiceNodesSubRequest extends OxendSubRequest {
public build() {
public async build() {
return {
method: this.method,
params: {
@ -343,7 +350,7 @@ export class SwarmForSubRequest extends SnodeAPISubRequest<'get_swarm'> {
this.destination = pubkey;
}
public build() {
public async build() {
return {
method: this.method,
params: {
@ -375,7 +382,7 @@ export class NetworkTimeSubRequest extends SnodeAPISubRequest<'info'> {
super({ method: 'info' });
}
public build() {
public async build() {
return {
method: this.method,
params: {},
@ -493,9 +500,12 @@ export class SubaccountUnrevokeSubRequest extends AbstractRevokeSubRequest<'unre
*/
export class GetExpiriesFromNodeSubRequest extends SnodeAPISubRequest<'get_expiries'> {
public readonly messageHashes: Array<string>;
public readonly getNow: () => number;
constructor(args: WithMessagesHashes) {
constructor(args: WithMessagesHashes & WithGetNow) {
super({ method: 'get_expiries' });
this.getNow = args.getNow;
this.messageHashes = args.messagesHashes;
if (this.messageHashes.length === 0) {
window.log.warn(`GetExpiriesFromNodeSubRequest given empty list of messageHashes`);
@ -506,7 +516,7 @@ export class GetExpiriesFromNodeSubRequest extends SnodeAPISubRequest<'get_expir
* For Revoke/unrevoke, this needs an admin signature
*/
public async build() {
const timestamp = NetworkTime.now();
const timestamp = this.getNow();
const ourPubKey = UserUtils.getOurPubKeyStrFromCache();
if (!ourPubKey) {
@ -871,6 +881,7 @@ export class StoreGroupMessageSubRequest extends StoreSubRequest {
constructor(
args: WithGroupPubkey &
WithGetNow &
WithCreatedAtNetworkTimestamp & {
ttlMs: number;
encryptedData: Uint8Array;
@ -879,7 +890,7 @@ export class StoreGroupMessageSubRequest extends StoreSubRequest {
secretKey: Uint8Array | null;
}
) {
super();
super(args);
this.destination = args.groupPk;
this.ttlMs = args.ttlMs;
this.encryptedData = args.encryptedData;
@ -954,16 +965,18 @@ abstract class StoreGroupConfigSubRequest<
public readonly secretKey: Uint8Array | null;
constructor(
args: WithGroupPubkey & {
namespace: T;
encryptedData: Uint8Array;
secretKey: Uint8Array | null;
}
args: WithGroupPubkey &
WithGetNow & {
namespace: T;
encryptedData: Uint8Array;
secretKey: Uint8Array | null;
ttlMs: number;
}
) {
super();
super(args);
this.namespace = args.namespace;
this.destination = args.groupPk;
this.ttlMs = TTL_DEFAULT.CONFIG_MESSAGE;
this.ttlMs = args.ttlMs;
this.encryptedData = args.encryptedData;
this.secretKey = args.secretKey;
@ -1061,12 +1074,14 @@ export class StoreUserConfigSubRequest extends StoreSubRequest {
public readonly encryptedData: Uint8Array;
public readonly destination: PubkeyType;
constructor(args: {
namespace: SnodeNamespacesUserConfig;
ttlMs: number;
encryptedData: Uint8Array;
}) {
super();
constructor(
args: WithGetNow & {
namespace: SnodeNamespacesUserConfig;
ttlMs: number;
encryptedData: Uint8Array;
}
) {
super(args);
this.namespace = args.namespace;
this.ttlMs = args.ttlMs;
this.encryptedData = args.encryptedData;
@ -1136,19 +1151,20 @@ export class StoreUserMessageSubRequest extends StoreSubRequest {
public readonly plainTextBuffer: Uint8Array | null;
constructor(
args: WithCreatedAtNetworkTimestamp & {
ttlMs: number;
encryptedData: Uint8Array;
destination: PubkeyType;
dbMessageIdentifier: string | null;
/**
* When we send a message to a 1o1 recipient, we then need to send the same message to our own swarm as a synced message.
* To forward that message, we need the original message data, which is the plainTextBuffer field here.
*/
plainTextBuffer: Uint8Array | null;
}
args: WithCreatedAtNetworkTimestamp &
WithGetNow & {
ttlMs: number;
encryptedData: Uint8Array;
destination: PubkeyType;
dbMessageIdentifier: string | null;
/**
* When we send a message to a 1o1 recipient, we then need to send the same message to our own swarm as a synced message.
* To forward that message, we need the original message data, which is the plainTextBuffer field here.
*/
plainTextBuffer: Uint8Array | null;
}
) {
super();
super(args);
this.ttlMs = args.ttlMs;
this.destination = args.destination;
this.encryptedData = args.encryptedData;
@ -1174,7 +1190,7 @@ export class StoreUserMessageSubRequest extends StoreSubRequest {
method: this.method,
params: {
pubkey: this.destination,
timestamp: NetworkTime.now(),
timestamp: this.getNow(),
namespace: this.namespace,
ttl: this.ttlMs,
data: encryptedDataBase64,
@ -1207,14 +1223,15 @@ export class StoreLegacyGroupMessageSubRequest extends StoreSubRequest {
public readonly createdAtNetworkTimestamp: number;
constructor(
args: WithCreatedAtNetworkTimestamp & {
ttlMs: number;
encryptedData: Uint8Array;
destination: PubkeyType;
dbMessageIdentifier: string | null;
}
args: WithCreatedAtNetworkTimestamp &
WithGetNow & {
ttlMs: number;
encryptedData: Uint8Array;
destination: PubkeyType;
dbMessageIdentifier: string | null;
}
) {
super();
super(args);
this.ttlMs = args.ttlMs;
this.destination = args.destination;
this.encryptedData = args.encryptedData;
@ -1237,7 +1254,7 @@ export class StoreLegacyGroupMessageSubRequest extends StoreSubRequest {
params: {
// no signature required for a legacy group retrieve/store of message to namespace -10
pubkey: this.destination,
timestamp: NetworkTime.now(),
timestamp: this.getNow(),
namespace: this.namespace,
ttl: this.ttlMs,
data: encryptedDataBase64,
@ -1359,13 +1376,6 @@ export function builtRequestToLoggingId(request: BuiltSnodeSubRequests): string
}
}
export type BatchResultEntry = {
code: number;
body: Record<string, any>;
};
export type NotEmptyArrayOfBatchResults = NonEmptyArray<BatchResultEntry>;
export const MAX_SUBREQUESTS_COUNT = 20;
export type BatchStoreWithExtraParams =

@ -10,10 +10,10 @@ import {
builtRequestToLoggingId,
BuiltSnodeSubRequests,
MAX_SUBREQUESTS_COUNT,
NotEmptyArrayOfBatchResults,
RawSnodeSubRequests,
WithMethodBatchType,
} from './SnodeRequestTypes';
import { NotEmptyArrayOfBatchResults } from './BatchResultEntry';
import { MergedAbortSignal, WithTimeoutMs } from './requestWith';
function logSubRequests(requests: Array<BuiltSnodeSubRequests>) {

@ -9,11 +9,8 @@ import { SeedNodeAPI } from '../seed_node_api';
import { MAX_SUBREQUESTS_COUNT, UpdateExpiryOnNodeUserSubRequest } from './SnodeRequestTypes';
import { BatchRequests } from './batchRequest';
import { SnodePool } from './snodePool';
import {
ExpireMessageResultItem,
ExpireMessagesResultsContent,
WithShortenOrExtend,
} from './types';
import { ExpireMessageResultItem, ExpireMessagesResultsContent } from './types';
import { WithShortenOrExtend } from '../../types/with';
import { DURATION } from '../../constants';
export type verifyExpireMsgsResponseSignatureProps = ExpireMessageResultItem & {

@ -17,6 +17,8 @@ import {
import { SnodeNamespaces } from '../namespaces';
import { GroupUpdateDeleteMemberContentMessage } from '../../../messages/outgoing/controlMessage/group_v2/to_group/GroupUpdateDeleteMemberContentMessage';
import { GroupUpdateMemberLeftNotificationMessage } from '../../../messages/outgoing/controlMessage/group_v2/to_group/GroupUpdateMemberLeftNotificationMessage';
import { TTL_DEFAULT } from '../../../constants';
import { NetworkTime } from '../../../../util/NetworkTime';
export type StoreMessageToSubRequestType =
| GroupUpdateMemberChangeMessage
@ -81,6 +83,7 @@ async function makeGroupMessageSubRequest(
dbMessageIdentifier: m.dbMessageIdentifier,
...group,
createdAtNetworkTimestamp: m.networkTimestamp,
getNow: NetworkTime.now,
});
});
@ -114,6 +117,8 @@ function makeStoreGroupKeysSubRequest({
encryptedData: encryptedSupplementKeys,
groupPk,
secretKey: group.secretKey,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
});
}
@ -151,6 +156,8 @@ function makeStoreGroupConfigSubRequest({
encryptedData: m.ciphertext,
groupPk,
secretKey: group.secretKey,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
})
: null
)
@ -163,6 +170,8 @@ function makeStoreGroupConfigSubRequest({
encryptedData: m.ciphertext,
groupPk,
secretKey: group.secretKey,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
})
: null
)
@ -175,6 +184,8 @@ function makeStoreGroupConfigSubRequest({
encryptedData: m.ciphertext,
groupPk,
secretKey: group.secretKey,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
})
: null
)

@ -8,8 +8,10 @@ import { SeedNodeAPI } from '../seed_node_api';
import { GetExpiriesFromNodeSubRequest } from './SnodeRequestTypes';
import { BatchRequests } from './batchRequest';
import { SnodePool } from './snodePool';
import { GetExpiriesResultsContent, WithMessagesHashes } from './types';
import { GetExpiriesResultsContent } from './types';
import { WithMessagesHashes } from '../../types/with';
import { DURATION } from '../../constants';
import { NetworkTime } from '../../../util/NetworkTime';
export type GetExpiriesRequestResponseResults = Record<string, number>;
@ -46,7 +48,10 @@ async function getExpiriesFromNodesNoRetries(
associatedWith: PubkeyType
) {
try {
const expireRequest = new GetExpiriesFromNodeSubRequest({ messagesHashes: messageHashes });
const expireRequest = new GetExpiriesFromNodeSubRequest({
messagesHashes: messageHashes,
getNow: NetworkTime.now,
});
const result = await BatchRequests.doUnsignedSnodeBatchRequestNoRetries({
unsignedSubRequests: [expireRequest],
targetNode,

@ -14,7 +14,8 @@ import { StringUtils, UserUtils } from '../../../utils';
import { fromUInt8ArrayToBase64, stringToUint8Array } from '../../../utils/String';
import { PreConditionFailed } from '../../../utils/errors';
import { SnodeNamespacesGroup } from '../namespaces';
import { SignedGroupHashesParams, WithMessagesHashes, WithShortenOrExtend } from '../types';
import { SignedGroupHashesParams } from '../types';
import { WithMessagesHashes, WithShortenOrExtend } from '../../../types/with';
import { SignatureShared } from './signatureShared';
import { SnodeSignatureResult } from './snodeSignatures';
import { getSodiumRenderer } from '../../../crypto';

@ -11,9 +11,15 @@ import { PubKey } from '../../../types';
import { StringUtils, UserUtils } from '../../../utils';
import { fromHexToArray, fromUInt8ArrayToBase64 } from '../../../utils/String';
import { PreConditionFailed } from '../../../utils/errors';
import { SignedHashesParams, WithMessagesHashes, WithShortenOrExtend } from '../types';
import { SignedHashesParams } from '../types';
import {
WithShortenOrExtend,
WithMessagesHashes,
WithSignature,
WithTimestamp,
} from '../../../types/with';
import { NetworkTime } from '../../../../util/NetworkTime';
import { WithSignature, WithTimestamp } from '../../../types/with';
export type SnodeSignatureResult = WithSignature &
WithTimestamp & {

@ -39,13 +39,8 @@ export type RetrieveRequestResult = {
messages: RetrieveMessagesResultsContent;
namespace: SnodeNamespaces;
};
export type WithMessagesHashes = { messagesHashes: Array<string> };
export type RetrieveMessagesResultsBatched = Array<RetrieveRequestResult>;
export type ShortenOrExtend = 'extend' | 'shorten' | '';
export type WithShortenOrExtend = { shortenOrExtend: ShortenOrExtend };
export type WithRevokeSubRequest = {
revokeSubRequest?: SubaccountRevokeSubRequest;
unrevokeSubRequest?: SubaccountUnrevokeSubRequest;

@ -17,7 +17,6 @@ import {
DeleteHashesFromGroupNodeSubRequest,
DeleteHashesFromUserNodeSubRequest,
MethodBatchType,
NotEmptyArrayOfBatchResults,
RawSnodeSubRequests,
StoreGroupInfoSubRequest,
StoreGroupKeysSubRequest,
@ -30,6 +29,7 @@ import {
SubaccountRevokeSubRequest,
SubaccountUnrevokeSubRequest,
} from '../apis/snode_api/SnodeRequestTypes';
import { NotEmptyArrayOfBatchResults } from '../apis/snode_api/BatchResultEntry';
import { BatchRequests } from '../apis/snode_api/batchRequest';
import { GetNetworkTime } from '../apis/snode_api/getNetworkTime';
import { SnodeNamespace, SnodeNamespaces } from '../apis/snode_api/namespaces';
@ -122,6 +122,7 @@ async function messageToRequest05({
namespace,
createdAtNetworkTimestamp: networkTimestamp,
plainTextBuffer,
getNow: NetworkTime.now,
};
if (namespace === SnodeNamespaces.Default) {
return new StoreUserMessageSubRequest(shared05Arguments);
@ -165,6 +166,7 @@ async function messageToRequest03({
groupPk: destination,
dbMessageIdentifier: identifier || null,
createdAtNetworkTimestamp: networkTimestamp,
getNow: NetworkTime.now,
...group,
};
if (

@ -13,12 +13,15 @@ export type WithRemoveMembers = { removed: Array<PubkeyType> };
export type WithPromotedMembers = { promoted: Array<PubkeyType> };
export type WithMaxSize = { max_size?: number };
export type WithShortenOrExtend = { shortenOrExtend: 'shorten' | 'extend' | '' };
export type WithCreatedAtNetworkTimestamp = { createdAtNetworkTimestamp: number };
export type WithMethod<T extends string> = { method: T };
export type WithBatchMethod<T extends string> = { method: T };
export type WithGetNow = { getNow: () => number };
export type WithConvoId = { conversationId: string };
export type WithMessageId = { messageId: string };
export type WithLocalMessageDeletionType = { deletionType: 'complete' | 'markDeleted' };
export type ShortenOrExtend = 'extend' | 'shorten' | '';
export type WithShortenOrExtend = { shortenOrExtend: ShortenOrExtend };
export type WithMessagesHashes = { messagesHashes: Array<string> };

@ -37,7 +37,7 @@ import {
WithSecretKey,
} from '../../../types/with';
import { groupInfoActions } from '../../../../state/ducks/metaGroups';
import { DURATION } from '../../../constants';
import { DURATION, TTL_DEFAULT } from '../../../constants';
import { timeoutWithAbort } from '../../Promise';
const defaultMsBetweenRetries = 10000;
@ -163,6 +163,8 @@ class GroupPendingRemovalsJob extends PersistedJob<GroupPendingRemovalsPersisted
encryptedData: multiEncryptedMessage,
groupPk,
secretKey: group.secretKey,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
});
const revokeRequests = compact([

@ -25,6 +25,7 @@ import {
RunJobResult,
UserSyncPersistedData,
} from '../PersistedJob';
import { NetworkTime } from '../../../../util/NetworkTime';
const defaultMsBetweenRetries = 5 * DURATION.SECONDS; // a long time between retries, to avoid running multiple jobs at the same time, when one was postponed at the same time as one already planned (5s)
const defaultMaxAttempts = 2;
@ -96,6 +97,7 @@ async function pushChangesToUserSwarmIfNeeded() {
encryptedData: m.ciphertext,
namespace: m.namespace,
ttlMs: TTL_DEFAULT.CONFIG_MESSAGE,
getNow: NetworkTime.now,
});
});

@ -21,7 +21,7 @@ import { SnodeNamespaces, SnodeNamespacesUserConfig } from '../../apis/snode_api
import {
BatchResultEntry,
NotEmptyArrayOfBatchResults,
} from '../../apis/snode_api/SnodeRequestTypes';
} from '../../apis/snode_api/BatchResultEntry';
import { PubKey } from '../../types';
import { ed25519Str } from '../String';

@ -8,7 +8,7 @@ import {
processGetExpiriesRequestResponse,
} from '../../../../session/apis/snode_api/getExpiriesRequest';
import { SnodeSignature } from '../../../../session/apis/snode_api/signature/snodeSignatures';
import { WithMessagesHashes } from '../../../../session/apis/snode_api/types';
import { WithMessagesHashes } from '../../../../session/types/with';
import { UserUtils } from '../../../../session/utils';
import { isValidUnixTimestamp } from '../../../../session/utils/Timestamps';
import { TypedStub, generateFakeSnode, stubWindowLog } from '../../../test-utils/utils';
@ -48,7 +48,7 @@ describe('GetExpiriesRequest', () => {
};
it('builds a valid request given the messageHashes and valid timestamp for now', async () => {
const unsigned = new GetExpiriesFromNodeSubRequest(props);
const unsigned = new GetExpiriesFromNodeSubRequest({ ...props, getNow: NetworkTime.now });
const request = await unsigned.build();
expect(request, 'should not return null').to.not.be.null;
@ -73,7 +73,7 @@ describe('GetExpiriesRequest', () => {
(getOurPubKeyStrFromCacheStub as any).returns(undefined);
let errorStr = 'fakeerror';
try {
const unsigned = new GetExpiriesFromNodeSubRequest(props);
const unsigned = new GetExpiriesFromNodeSubRequest({ ...props, getNow: NetworkTime.now });
const request = await unsigned.build();
if (request) {
throw new Error('we should not have been able to build a request');
@ -88,7 +88,7 @@ describe('GetExpiriesRequest', () => {
// Modify the stub behavior for this test only we need to return an unsupported type to simulate a missing pubkey
Sinon.stub(SnodeSignature, 'generateGetExpiriesOurSignature').resolves(null);
const unsigned = new GetExpiriesFromNodeSubRequest(props);
const unsigned = new GetExpiriesFromNodeSubRequest({ ...props, getNow: NetworkTime.now });
try {
const request = await unsigned.build();
if (request) {

@ -12,7 +12,7 @@ import {
} from '../../../../session/apis/snode_api/SnodeRequestTypes';
import { SnodeNamespaces } from '../../../../session/apis/snode_api/namespaces';
import { SnodeAPIRetrieve } from '../../../../session/apis/snode_api/retrieveRequest';
import { WithShortenOrExtend } from '../../../../session/apis/snode_api/types';
import { WithShortenOrExtend } from '../../../../session/types/with';
import { TestUtils } from '../../../test-utils';
import { expectAsyncToThrow, stubLibSessionWorker } from '../../../test-utils/utils';
import { NetworkTime } from '../../../../util/NetworkTime';

@ -4,7 +4,7 @@ import { omit } from 'lodash';
import Long from 'long';
import Sinon from 'sinon';
import { getSodiumNode } from '../../../../../../node/sodiumNode';
import { NotEmptyArrayOfBatchResults } from '../../../../../../session/apis/snode_api/SnodeRequestTypes';
import { NotEmptyArrayOfBatchResults } from '../../../../../../session/apis/snode_api/BatchResultEntry';
import { SnodeNamespaces } from '../../../../../../session/apis/snode_api/namespaces';
import { ConvoHub } from '../../../../../../session/conversations';
import { LibSodiumWrappers } from '../../../../../../session/crypto';

@ -3,7 +3,7 @@ import { omit } from 'lodash';
import Long from 'long';
import Sinon from 'sinon';
import { getSodiumNode } from '../../../../../../node/sodiumNode';
import { NotEmptyArrayOfBatchResults } from '../../../../../../session/apis/snode_api/SnodeRequestTypes';
import { NotEmptyArrayOfBatchResults } from '../../../../../../session/apis/snode_api/BatchResultEntry';
import {
SnodeNamespaces,
SnodeNamespacesUserConfig,

@ -269,7 +269,6 @@ export function getLegacyGroupInfoFromDBValues({
/**
* This function can be used to make sure all the possible values as input of a switch as taken care off, without having a default case.
*
*/
export function assertUnreachable(_x: never, message: string): never {
const msg = `assertUnreachable: Didn't expect to get here with "${message}"`;

Loading…
Cancel
Save