diff --git a/ts/components/menu/ConversationListItemContextMenu.tsx b/ts/components/menu/ConversationListItemContextMenu.tsx index c8cbeda5e..8b407032c 100644 --- a/ts/components/menu/ConversationListItemContextMenu.tsx +++ b/ts/components/menu/ConversationListItemContextMenu.tsx @@ -41,6 +41,7 @@ const ConversationListItemContextMenu = (props: PropsContextConversationItem) => if (isSearchingMode) { return null; } + return ( diff --git a/ts/receiver/configMessage.ts b/ts/receiver/configMessage.ts index dbf842190..0d1b52ad4 100644 --- a/ts/receiver/configMessage.ts +++ b/ts/receiver/configMessage.ts @@ -35,6 +35,7 @@ import { ReleasedFeatures } from '../util/releaseFeature'; import { Storage, getLastProfileUpdateTimestamp, + isSignInByLinking, setLastProfileUpdateTimestamp, } from '../util/storage'; import { ConfigWrapperObjectTypes } from '../webworker/workers/browser/libsession_worker_functions'; @@ -767,7 +768,7 @@ async function handleOurProfileUpdateLegacy( ) { const userConfigLibsession = await ReleasedFeatures.checkIsUserConfigFeatureReleased(); // we want to allow if we are not registered, as we might need to fetch an old config message (can be removed once we released for a weeks the libsession util) - if (userConfigLibsession && Registration.isDone()) { + if (userConfigLibsession && !isSignInByLinking()) { return; } const latestProfileUpdateTimestamp = getLastProfileUpdateTimestamp(); @@ -978,7 +979,7 @@ async function handleConfigurationMessageLegacy( // the process of those messages is always done after the process of the shared config messages, so that's only a fallback. const userConfigLibsession = await ReleasedFeatures.checkIsUserConfigFeatureReleased(); - if (userConfigLibsession && Registration.isDone()) { + if (userConfigLibsession && !isSignInByLinking()) { window?.log?.info( 'useSharedUtilForUserConfig is set, not handling config messages with "handleConfigurationMessageLegacy()"' ); @@ -987,7 +988,7 @@ async function handleConfigurationMessageLegacy( return; } - window?.log?.info('Handling configuration message'); + window?.log?.info('Handling legacy configuration message'); const ourPubkey = UserUtils.getOurPubKeyStrFromCache(); if (!ourPubkey) { return; diff --git a/ts/session/apis/snode_api/snodePool.ts b/ts/session/apis/snode_api/snodePool.ts index ece4b4f60..9f69ce9bd 100644 --- a/ts/session/apis/snode_api/snodePool.ts +++ b/ts/session/apis/snode_api/snodePool.ts @@ -189,9 +189,11 @@ export async function TEST_fetchFromSeedWithRetriesAndWriteToDb() { return; } + const start = Date.now(); try { randomSnodePool = await SeedNodeAPI.fetchSnodePoolFromSeedNodeWithRetries(seedNodes); await Data.updateSnodePoolOnDb(JSON.stringify(randomSnodePool)); + window.log.info(`fetchSnodePoolFromSeedNodeWithRetries took ${Date.now() - start}ms`); OnionPaths.resetPathFailureCount(); Onions.resetSnodeFailureCount(); diff --git a/ts/session/onions/onionPath.ts b/ts/session/onions/onionPath.ts index 0fb74988b..8e1760183 100644 --- a/ts/session/onions/onionPath.ts +++ b/ts/session/onions/onionPath.ts @@ -431,7 +431,9 @@ export async function getGuardNodeOrSelectNewOnes() { // If guard nodes is still empty (the old nodes are now invalid), select new ones: if (guardNodes.length < desiredGuardCount) { // if an error is thrown, the caller must take care of it. + const start = Date.now(); guardNodes = await OnionPaths.selectGuardNodes(); + window.log.info(`OnionPaths.selectGuardNodes took ${Date.now() - start}ms`); } } diff --git a/ts/util/accountManager.ts b/ts/util/accountManager.ts index 62c0d2cfb..cbe6961bb 100644 --- a/ts/util/accountManager.ts +++ b/ts/util/accountManager.ts @@ -176,8 +176,13 @@ async function createAccount(identityKeyPair: SessionKeyPair) { await setLocalPubKey(pubKeyString); } +/** + * + * @param ourPubkey the pubkey recovered from the seed + * @param displayName the display name entered by the user, if any. This is not a display name found from a config message in the network. + */ async function registrationDone(ourPubkey: string, displayName: string) { - window?.log?.info('registration done'); + window?.log?.info(`registration done with user provided displayName "${displayName}"`); // initializeLibSessionUtilWrappers needs our publicKey to be set await Storage.put('primaryDevicePubKey', ourPubkey); @@ -208,5 +213,6 @@ async function registrationDone(ourPubkey: string, displayName: string) { window.inboxStore?.dispatch(userActions.userChanged(user)); window?.log?.info('dispatching registration event'); + // this will make the poller start fetching messages, needed to find a configuration message trigger('registration_done'); } diff --git a/ts/util/registration.ts b/ts/util/registration.ts index 446efdc84..99b9513b0 100644 --- a/ts/util/registration.ts +++ b/ts/util/registration.ts @@ -1,10 +1,7 @@ import { Storage } from './storage'; -async function markEverDone() { - await Storage.put('chromiumRegistrationDoneEver', ''); -} async function markDone() { - await markEverDone(); + await Storage.put('chromiumRegistrationDoneEver', ''); await Storage.put('chromiumRegistrationDone', ''); } function isDone() { @@ -20,4 +17,4 @@ async function remove() { await Storage.remove('chromiumRegistrationDone'); } -export const Registration = { markEverDone, markDone, isDone, everDone, remove }; +export const Registration = { markDone, isDone, everDone, remove };