fix: compilation issues since merge

unwrapped was duplicating in onboarding1, so I had to duplicate my fix
to not unwrap it
pull/3122/head
Audric Ackermann 10 months ago
parent 6747652c8c
commit 60c6f47bfa

@ -1,7 +1,7 @@
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
/* eslint-disable more/no-then */ /* eslint-disable more/no-then */
/* eslint-disable @typescript-eslint/no-misused-promises */ /* eslint-disable @typescript-eslint/no-misused-promises */
import { compact, concat, flatten, isEmpty, last, sample, toNumber, uniqBy } from 'lodash'; import { compact, concat, flatten, isEmpty, last, sample, uniqBy } from 'lodash';
import { Data, Snode } from '../../../data/data'; import { Data, Snode } from '../../../data/data';
import { SignalService } from '../../../protobuf'; import { SignalService } from '../../../protobuf';
import * as Receiver from '../../../receiver/receiver'; import * as Receiver from '../../../receiver/receiver';
@ -377,7 +377,6 @@ export class SwarmPolling {
userConfigMessagesMerged: Array<RetrieveMessageItemWithNamespace>, userConfigMessagesMerged: Array<RetrieveMessageItemWithNamespace>,
returnDisplayNameOnly?: boolean returnDisplayNameOnly?: boolean
): Promise<string> { ): Promise<string> {
if (!userConfigMessagesMerged.length) { if (!userConfigMessagesMerged.length) {
return ''; return '';
} }
@ -410,10 +409,7 @@ export class SwarmPolling {
} }
return userInfo.name; return userInfo.name;
} catch (e) { } catch (e) {
window.log.warn( window.log.warn('LibSessionUtil.initializeLibSessionUtilWrappers failed with', e.message);
'LibSessionUtil.initializeLibSessionUtilWrappers failed with',
e.message
);
} finally { } finally {
await GenericWrapperActions.free('UserConfig'); await GenericWrapperActions.free('UserConfig');
} }
@ -428,8 +424,7 @@ export class SwarmPolling {
`failed to handle messages hashes "${allMessageHases}" with libsession. Error: "${e.message}"` `failed to handle messages hashes "${allMessageHases}" with libsession. Error: "${e.message}"`
); );
} }
return '' return '';
} }
// Fetches messages for `pubkey` from `node` potentially updating // Fetches messages for `pubkey` from `node` potentially updating
@ -693,11 +688,14 @@ export class SwarmPolling {
); );
} }
const userConfigMessages = resultsFromUserProfile const userConfigMessagesWithNamespace: Array<Array<RetrieveMessageItemWithNamespace>> =
.filter(m => SnodeNamespace.isUserConfigNamespace(m.namespace)) resultsFromUserProfile.map(r => {
.map(r => r.messages.messages); return (r.messages.messages || []).map(m => {
return { ...m, namespace: SnodeNamespaces.UserProfile };
});
});
const userConfigMessagesMerged = flatten(compact(userConfigMessages)); const userConfigMessagesMerged = flatten(compact(userConfigMessagesWithNamespace));
if (!userConfigMessagesMerged.length) { if (!userConfigMessagesMerged.length) {
throw new NotFoundError( throw new NotFoundError(
'[pollOnceForOurDisplayName] after merging there are no user config messages' '[pollOnceForOurDisplayName] after merging there are no user config messages'

Loading…
Cancel
Save