@ -6,27 +6,26 @@ import { PubKey } from '../../types';
import { ERROR_CODE_NO_CONNECT } from './SNodeAPI' ;
import * as snodePool from './snodePool' ;
import pRetry from 'p-retry' ;
import { ConversationModel } from '../../../models/conversation' ;
import { ConfigMessageHandler } from '../../../receiver/configMessage' ;
import { decryptEnvelopeWithOurKey } from '../../../receiver/contentMessage' ;
import { EnvelopePlus } from '../../../receiver/types' ;
import { updateIsOnline } from '../../../state/ducks/onion' ;
import { ReleasedFeatures } from '../../../util/releaseFeature' ;
import {
GenericWrapperActions ,
UserGroupsWrapperActions ,
} from '../../../webworker/workers/browser/libsession_worker_interface' ;
import { DURATION , SWARM_POLLING_TIMEOUT } from '../../constants' ;
import { getConversationController } from '../../conversations' ;
import { IncomingMessage } from '../../messages/incoming/IncomingMessage' ;
import { ed25519Str } from '../../onions/onionPath' ;
import { StringUtils , UserUtils } from '../../utils' ;
import { perfEnd , perfStart } from '../../utils/Performance' ;
import { LibSessionUtil } from '../../utils/libsession/libsession_utils' ;
import { SnodeNamespace , SnodeNamespaces } from './namespaces' ;
import { SnodeAPIRetrieve } from './retrieveRequest' ;
import { RetrieveMessageItem , RetrieveMessagesResultsBatched } from './types' ;
import { ReleasedFeatures } from '../../../util/releaseFeature' ;
import { LibSessionUtil } from '../../utils/libsession/libsession_utils' ;
import {
GenericWrapperActions ,
UserGroupsWrapperActions ,
} from '../../../webworker/workers/browser/libsession_worker_interface' ;
export function extractWebSocketContent (
message : string ,
@ -404,8 +403,6 @@ export class SwarmPolling {
const pkStr = pubkey . key ;
try {
return await pRetry (
async ( ) = > {
const prevHashes = await Promise . all (
namespaces . map ( namespace = > this . getLastHash ( snodeEdkey , pkStr , namespace ) )
) ;
@ -480,17 +477,6 @@ export class SwarmPolling {
) ;
return results ;
} ,
{
minTimeout : 100 ,
retries : 1 ,
onFailedAttempt : e = > {
window ? . log ? . warn (
` retrieveNextMessages attempt # ${ e . attemptNumber } failed. ${ e . retriesLeft } retries left... ${ e . name } `
) ;
} ,
}
) ;
} catch ( e ) {
if ( e . message === ERROR_CODE_NO_CONNECT ) {
if ( window . inboxStore ? . getState ( ) . onionPaths . isOnline ) {