Merge branch 'feat/ses-50/onboarding' into feat/ses-899/user_profile_poll

pull/3056/head
William Grant 1 year ago
commit 5ce8170188

File diff suppressed because it is too large Load Diff

@ -27,7 +27,7 @@ export const YourSessionIDPill = () => {
return ( return (
<StyledPillDivider> <StyledPillDivider>
<StyledPillDividerLine /> <StyledPillDividerLine />
<StyledPillSpan>{window.i18n('yourSessionID')}</StyledPillSpan> <StyledPillSpan>{window.i18n('accountIdYours')}</StyledPillSpan>
<StyledPillDividerLine /> <StyledPillDividerLine />
</StyledPillDivider> </StyledPillDivider>
); );

@ -209,8 +209,8 @@ export class SessionConversation extends Component<Props, State> {
if (msg.body.replace(/\s/g, '').includes(recoveryPhrase.replace(/\s/g, ''))) { if (msg.body.replace(/\s/g, '').includes(recoveryPhrase.replace(/\s/g, ''))) {
window.inboxStore?.dispatch( window.inboxStore?.dispatch(
updateConfirmModal({ updateConfirmModal({
title: window.i18n('sendRecoveryPhraseTitle'), title: window.i18n('warning'),
message: window.i18n('sendRecoveryPhraseMessage'), message: window.i18n('recoveryPasswordWarningSendDescription'),
okTheme: SessionButtonColor.Danger, okTheme: SessionButtonColor.Danger,
onClickOk: () => { onClickOk: () => {
void sendAndScroll(); void sendAndScroll();

@ -46,7 +46,7 @@ export const ConversationRequestExplanation = () => {
return ( return (
<Container> <Container>
<TextInner>{window.i18n('respondingToRequestWarning')}</TextInner> <TextInner>{window.i18n('messageRequestsAcceptDescription')}</TextInner>
</Container> </Container>
); );
}; };

@ -62,7 +62,7 @@ export const MessageAvatar = (props: Props) => {
return; return;
} }
if (isPublic && !PubKey.isBlinded(sender)) { if (isPublic && !PubKey.isBlinded(sender)) {
// public chat but session id not blinded. disable showing user details if we do not have an active convo with that user. // public chat but account id not blinded. disable showing user details if we do not have an active convo with that user.
// an unactive convo with that user means that we never chatted with that id directyly, but only through a sogs // an unactive convo with that user means that we never chatted with that id directyly, but only through a sogs
const convoWithSender = getConversationController().get(sender); const convoWithSender = getConversationController().get(sender);
if (!convoWithSender || !convoWithSender.get('active_at')) { if (!convoWithSender || !convoWithSender.get('active_at')) {

@ -134,7 +134,7 @@ export const BanOrUnBanUserDialog = (props: {
ref={inputRef} ref={inputRef}
type="text" type="text"
darkMode={darkMode} darkMode={darkMode}
placeholder={i18n('enterSessionID')} placeholder={i18n('accountIdEnter')}
dir="auto" dir="auto"
onChange={onPubkeyBoxChanges} onChange={onPubkeyBoxChanges}
disabled={inProgress || wasGivenAPubkey} disabled={inProgress || wasGivenAPubkey}

@ -86,7 +86,7 @@ export const AddModeratorsDialog = (props: Props) => {
<SessionHeaderSearchInput <SessionHeaderSearchInput
type="text" type="text"
darkMode={darkMode} darkMode={darkMode}
placeholder={i18n('enterSessionID')} placeholder={i18n('accountIdEnter')}
dir="auto" dir="auto"
onChange={onPubkeyBoxChanges} onChange={onPubkeyBoxChanges}
disabled={addingInProgress} disabled={addingInProgress}

@ -220,7 +220,7 @@ const SessionSeedModalInner = (props: ModalInnerProps) => {
<> <>
{!loadingSeed && ( {!loadingSeed && (
<SessionWrapperModal <SessionWrapperModal
title={window.i18n('showRecoveryPhrase')} title={window.i18n('sessionRecoveryPassword')}
onClose={onClose} onClose={onClose}
showExitIcon={true} showExitIcon={true}
> >

@ -48,7 +48,7 @@ export function TermsOfServicePrivacyDialog(props: TermsOfServicePrivacyDialogPr
onClick={() => { onClick={() => {
void shell.openExternal('https://getsession.org/terms-of-service'); void shell.openExternal('https://getsession.org/terms-of-service');
}} }}
dataTestId="session-tos-button" dataTestId="terms-of-service-button"
/> />
<SessionButton <SessionButton
text={window.i18n('privacyPolicy')} text={window.i18n('privacyPolicy')}
@ -57,7 +57,7 @@ export function TermsOfServicePrivacyDialog(props: TermsOfServicePrivacyDialogPr
onClick={() => { onClick={() => {
void shell.openExternal('https://getsession.org/privacy-policy'); void shell.openExternal('https://getsession.org/privacy-policy');
}} }}
dataTestId="session-privacy-policy-button" dataTestId="privacy-policy-button"
/> />
</ConfirmButtonContainer> </ConfirmButtonContainer>
</div> </div>

@ -62,6 +62,7 @@ const ErrorItem = (props: { id: string; error: string }) => {
initial={{ opacity: 0 }} initial={{ opacity: 0 }}
animate={{ opacity: 1 }} animate={{ opacity: 1 }}
transition={{ duration: THEME_GLOBALS['--default-duration-seconds'] }} transition={{ duration: THEME_GLOBALS['--default-duration-seconds'] }}
data-testid="session-error-message"
> >
{props.error} {props.error}
</motion.label> </motion.label>
@ -89,6 +90,7 @@ const ShowHideButton = (props: { forceShow: boolean; toggleForceShow: Noop; erro
transform: 'translateY(-50%)', transform: 'translateY(-50%)',
...position, ...position,
}} }}
dataTestId="reveal-recovery-phrase-toggle"
/> />
); );
} }
@ -100,6 +102,7 @@ const ShowHideButton = (props: { forceShow: boolean; toggleForceShow: Noop; erro
iconSize="medium" iconSize="medium"
onClick={props.toggleForceShow} onClick={props.toggleForceShow}
style={{ position: 'absolute', top: '50%', transform: 'translateY(-50%)', ...position }} style={{ position: 'absolute', top: '50%', transform: 'translateY(-50%)', ...position }}
dataTestId="reveal-recovery-phrase-toggle"
/> />
); );
}; };

@ -170,7 +170,7 @@ const setupTheme = async () => {
await switchThemeTo(themeConfig); await switchThemeTo(themeConfig);
}; };
// Do this only if we created a new Session ID, or if we already received the initial configuration message // Do this only if we created a new account id, or if we already received the initial configuration message
const triggerSyncIfNeeded = async () => { const triggerSyncIfNeeded = async () => {
const us = UserUtils.getOurPubKeyStrFromCache(); const us = UserUtils.getOurPubKeyStrFromCache();
await getConversationController().get(us).setDidApproveMe(true, true); await getConversationController().get(us).setDidApproveMe(true, true);

@ -72,8 +72,8 @@ const getCategories = () => {
title: window.i18n('helpSettingsTitle'), title: window.i18n('helpSettingsTitle'),
}, },
{ {
id: SessionSettingCategory.RecoveryPhrase, id: SessionSettingCategory.RecoveryPassword,
title: window.i18n('recoveryPhrase'), title: window.i18n('sessionRecoveryPassword'),
}, },
{ {
id: SessionSettingCategory.ClearData, id: SessionSettingCategory.ClearData,
@ -107,7 +107,7 @@ const LeftPaneSettingsCategoryRow = (props: {
dispatch(setLeftOverlayMode('message-requests')); dispatch(setLeftOverlayMode('message-requests'));
dispatch(resetConversationExternal()); dispatch(resetConversationExternal());
break; break;
case SessionSettingCategory.RecoveryPhrase: case SessionSettingCategory.RecoveryPassword:
dispatch(recoveryPhraseModal({})); dispatch(recoveryPhraseModal({}));
break; break;
case SessionSettingCategory.ClearData: case SessionSettingCategory.ClearData:

@ -51,8 +51,8 @@ export const OverlayMessage = () => {
const title = window.i18n('newMessage'); const title = window.i18n('newMessage');
const buttonText = window.i18n('next'); const buttonText = window.i18n('next');
const subtitle = window.i18n('enterSessionID'); const subtitle = window.i18n('accountIdEnter');
const placeholder = window.i18n('enterSessionIDOrONSName'); const placeholder = window.i18n('accountIdEnterYourFriends');
const disableNextButton = !pubkeyOrOns || loading; const disableNextButton = !pubkeyOrOns || loading;
@ -80,7 +80,7 @@ export const OverlayMessage = () => {
async function handleMessageButtonClick() { async function handleMessageButtonClick() {
if ((!pubkeyOrOns && !pubkeyOrOns.length) || !pubkeyOrOns.trim().length) { if ((!pubkeyOrOns && !pubkeyOrOns.length) || !pubkeyOrOns.trim().length) {
ToastUtils.pushToastError('invalidPubKey', window.i18n('invalidNumberError')); // or ons name ToastUtils.pushToastError('invalidPubKey', window.i18n('onsErrorNotRecognised')); // or ons name
return; return;
} }
const pubkeyorOnsTrimmed = pubkeyOrOns.trim(); const pubkeyorOnsTrimmed = pubkeyOrOns.trim();
@ -93,7 +93,7 @@ export const OverlayMessage = () => {
// this might be an ONS, validate the regex first // this might be an ONS, validate the regex first
const mightBeOnsName = new RegExp(ONSResolve.onsNameRegex, 'g').test(pubkeyorOnsTrimmed); const mightBeOnsName = new RegExp(ONSResolve.onsNameRegex, 'g').test(pubkeyorOnsTrimmed);
if (!mightBeOnsName) { if (!mightBeOnsName) {
ToastUtils.pushToastError('invalidPubKey', window.i18n('invalidNumberError')); ToastUtils.pushToastError('invalidPubKey', window.i18n('onsErrorNotRecognised'));
return; return;
} }
setLoading(true); setLoading(true);
@ -126,7 +126,7 @@ export const OverlayMessage = () => {
<SessionSpinner loading={loading} /> <SessionSpinner loading={loading} />
<SessionIDDescription>{window.i18n('startNewConversationBy...')}</SessionIDDescription> <SessionIDDescription>{window.i18n('messageNewDescription')}</SessionIDDescription>
<Flex container={true} width="100%"> <Flex container={true} width="100%">
<SpacerMD /> <SpacerMD />

@ -68,7 +68,7 @@ export function SessionProgressBar(props: Props) {
{showPercentage ? <StyledText>{Math.floor(progress)}%</StyledText> : null} {showPercentage ? <StyledText>{Math.floor(progress)}%</StyledText> : null}
</Flex> </Flex>
{subtitle || showPercentage ? <SpacerXL /> : null} {subtitle || showPercentage ? <SpacerXL /> : null}
<ProgressContainer color={backgroundColor} style={{ width }}> <ProgressContainer color={backgroundColor} style={{ width }} data-testid="loading-animation">
<Progress <Progress
color={color} color={color}
initial={{ width: 0 }} initial={{ width: 0 }}

@ -301,7 +301,7 @@ export const CopyMenuItem = (): JSX.Element | null => {
// we want to show the copyId for open groups and private chats only // we want to show the copyId for open groups and private chats only
if ((isPrivate && !isBlinded) || isPublic) { if ((isPrivate && !isBlinded) || isPublic) {
const copyIdLabel = isPublic ? window.i18n('copyOpenGroupURL') : window.i18n('copySessionID'); const copyIdLabel = isPublic ? window.i18n('copyOpenGroupURL') : window.i18n('accountIDCopy');
return ( return (
<Item <Item
onClick={() => { onClick={() => {

@ -70,18 +70,20 @@ export const RegistrationStages = () => {
iconPadding="4px" iconPadding="4px"
iconColor="var(--text-primary-color)" iconColor="var(--text-primary-color)"
style={{ border: '2px solid var(--text-primary-color)', borderRadius: '9999px' }} style={{ border: '2px solid var(--text-primary-color)', borderRadius: '9999px' }}
dataTestId="session-faq-link"
onClick={() => { onClick={() => {
void shell.openExternal('https://getsession.org/faq'); void shell.openExternal('https://getsession.org/faq');
}} }}
/> />
<SpacerSM /> <SpacerSM />
<SessionIconButton <SessionIconButton
aria-label="external link to Session FAQ web page" aria-label="external link to Session website"
iconType="link" iconType="link"
iconSize="medium" iconSize="medium"
iconColor="var(--text-primary-color)" iconColor="var(--text-primary-color)"
iconPadding="4px" iconPadding="4px"
style={{ border: '2px solid var(--text-primary-color)', borderRadius: '9999px' }} style={{ border: '2px solid var(--text-primary-color)', borderRadius: '9999px' }}
dataTestId="session-website-link"
onClick={() => { onClick={() => {
void shell.openExternal('https://getsession.org'); void shell.openExternal('https://getsession.org');
}} }}

@ -22,6 +22,7 @@ export const TermsAndConditions = () => {
return ( return (
<StyledTermsAndConditions <StyledTermsAndConditions
onClick={() => dispatch(updateTermsOfServicePrivacyModal({ show: true }))} onClick={() => dispatch(updateTermsOfServicePrivacyModal({ show: true }))}
data-testid="terms-of-service-link"
> >
<SessionHtmlRenderer html={window.i18n('onboardingTosPrivacy')} /> <SessionHtmlRenderer html={window.i18n('onboardingTosPrivacy')} />
</StyledTermsAndConditions> </StyledTermsAndConditions>

@ -44,7 +44,7 @@ export const useRecoveryProgressEffect = (props: UseRecoveryProgressEffectProps)
clearInterval(interval); clearInterval(interval);
// if we didn't get the display name in time, we need to enter it manually // if we didn't get the display name in time, we need to enter it manually
window.log.debug( window.log.debug(
`WIP: [continueYourSession] AccountRestoration.Loading We didn't get the display name in time, so we need to enter it manually` `WIP: [useRecoveryProgressEffect] AccountRestoration.Loading We didn't get the display name in time, so we need to enter it manually`
); );
dispatch(setAccountRestorationStep(AccountRestoration.DisplayName)); dispatch(setAccountRestorationStep(AccountRestoration.DisplayName));
} }
@ -57,7 +57,7 @@ export const useRecoveryProgressEffect = (props: UseRecoveryProgressEffectProps)
dispatch(setProgress(progress + 1)); dispatch(setProgress(progress + 1));
} }
window.log.debug( window.log.debug(
`WIP: [continueYourSession] AccountRestoration. Finishing progress ${progress}%` `WIP: [useRecoveryProgressEffect] AccountRestoration. Finishing progress ${progress}%`
); );
if (progress >= 100) { if (progress >= 100) {
@ -72,13 +72,13 @@ export const useRecoveryProgressEffect = (props: UseRecoveryProgressEffectProps)
clearInterval(interval); clearInterval(interval);
if (!isEmpty(displayName)) { if (!isEmpty(displayName)) {
window.log.debug( window.log.debug(
`WIP: [continueYourSession] AccountRestoration.Complete Finished progress` `WIP: [useRecoveryProgressEffect] AccountRestoration.Complete Finished progress`
); );
dispatch(setAccountRestorationStep(AccountRestoration.Complete)); dispatch(setAccountRestorationStep(AccountRestoration.Complete));
} else { } else {
dispatch(setAccountRestorationStep(AccountRestoration.DisplayName)); dispatch(setAccountRestorationStep(AccountRestoration.DisplayName));
window.log.debug( window.log.debug(
`WIP: [continueYourSession] AccountRestoration.DisplayName failed to fetch display name so we need to enter it manually` `WIP: [useRecoveryProgressEffect] AccountRestoration.DisplayName failed to fetch display name so we need to enter it manually`
); );
} }
}, ONBOARDING_TIMES.RECOVERY_FINISHED); }, ONBOARDING_TIMES.RECOVERY_FINISHED);
@ -88,7 +88,7 @@ export const useRecoveryProgressEffect = (props: UseRecoveryProgressEffectProps)
clearInterval(interval); clearInterval(interval);
if (!isEmpty(displayName)) { if (!isEmpty(displayName)) {
window.log.debug( window.log.debug(
`WIP: [continueYourSession] AccountRestoration.Complete opening inbox for ${displayName}` `WIP: [useRecoveryProgressEffect] AccountRestoration.Complete opening inbox for ${displayName}`
); );
dispatch(resetOnboardingState()); dispatch(resetOnboardingState());
trigger('openInbox'); trigger('openInbox');

@ -158,6 +158,7 @@ export const CreateAccount = () => {
onClick={signUpWithDetails} onClick={signUpWithDetails}
text={window.i18n('continue')} text={window.i18n('continue')}
disabled={!(!!displayName && !displayNameError)} disabled={!(!!displayName && !displayNameError)}
dataTestId="continue-button"
/> />
</Flex> </Flex>
</BackButtonWithininContainer> </BackButtonWithininContainer>

@ -64,7 +64,7 @@ async function signInWithNewDisplayName(signInDetails: RecoverDetails) {
} }
/** /**
* This will try to sign in with the user recovery phrase. * This will try to sign in with the user recovery password.
* If no ConfigurationMessage is received within ONBOARDING_RECOVERY_TIMEOUT, the user will be asked to enter a display name. * If no ConfigurationMessage is received within ONBOARDING_RECOVERY_TIMEOUT, the user will be asked to enter a display name.
*/ */
async function signInAndFetchDisplayName( async function signInAndFetchDisplayName(
@ -232,13 +232,13 @@ export const RestoreAccount = () => {
autoFocus={true} autoFocus={true}
disabledOnBlur={true} disabledOnBlur={true}
type="password" type="password"
placeholder={window.i18n('enterRecoveryPhrase')} placeholder={window.i18n('recoveryPasswordEnter')}
value={recoveryPassword} value={recoveryPassword}
onValueChanged={(seed: string) => { onValueChanged={(seed: string) => {
dispatch(setRecoveryPassword(seed)); dispatch(setRecoveryPassword(seed));
dispatch( dispatch(
setRecoveryPasswordError( setRecoveryPasswordError(
!seed ? window.i18n('recoveryPhraseEmpty') : undefined !seed ? window.i18n('recoveryPasswordEnter') : undefined
) )
); );
}} }}
@ -253,7 +253,7 @@ export const RestoreAccount = () => {
onClick={recoverAndFetchDisplayName} onClick={recoverAndFetchDisplayName}
text={window.i18n('continue')} text={window.i18n('continue')}
disabled={!(!!recoveryPassword && !recoveryPasswordError)} disabled={!(!!recoveryPassword && !recoveryPasswordError)}
dataTestId="continue-session-button" dataTestId="continue-button"
/> />
</> </>
) : ( ) : (
@ -285,7 +285,7 @@ export const RestoreAccount = () => {
!(!!recoveryPassword && !recoveryPasswordError) || !(!!recoveryPassword && !recoveryPasswordError) ||
!(!!displayName && !displayNameError) !(!!displayName && !displayNameError)
} }
dataTestId="continue-session-button" dataTestId="continue-button"
/> />
</Flex> </Flex>
)} )}

@ -25,6 +25,7 @@ export const Start = () => {
dispatch(setOnboardingStep(Onboarding.CreateAccount)); dispatch(setOnboardingStep(Onboarding.CreateAccount));
}} }}
text={window.i18n('onboardingAccountCreate')} text={window.i18n('onboardingAccountCreate')}
dataTestId="create-account-button"
/> />
<SpacerLG /> <SpacerLG />
<SessionButton <SessionButton
@ -35,7 +36,7 @@ export const Start = () => {
dispatch(setAccountRestorationStep(AccountRestoration.RecoveryPassword)); dispatch(setAccountRestorationStep(AccountRestoration.RecoveryPassword));
}} }}
text={window.i18n('onboardingAccountExists')} text={window.i18n('onboardingAccountExists')}
dataTestId="restore-using-recovery" dataTestId="existing-account-button"
/> />
<SpacerLG /> <SpacerLG />
<TermsAndConditions /> <TermsAndConditions />

@ -50,7 +50,7 @@ export enum SessionSettingCategory {
Appearance = 'appearance', Appearance = 'appearance',
Permissions = 'permissions', Permissions = 'permissions',
Help = 'help', Help = 'help',
RecoveryPhrase = 'recoveryPhrase', RecoveryPassword = 'recoveryPassword',
ClearData = 'ClearData', ClearData = 'ClearData',
} }
@ -139,7 +139,7 @@ const SettingInCategory = (props: {
// these three down there have no options, they are just a button // these three down there have no options, they are just a button
case SessionSettingCategory.ClearData: case SessionSettingCategory.ClearData:
case SessionSettingCategory.MessageRequests: case SessionSettingCategory.MessageRequests:
case SessionSettingCategory.RecoveryPhrase: case SessionSettingCategory.RecoveryPassword:
default: default:
return null; return null;
} }

@ -45,7 +45,7 @@ export const SettingsHeader = (props: Props) => {
break; break;
case SessionSettingCategory.ClearData: case SessionSettingCategory.ClearData:
case SessionSettingCategory.MessageRequests: case SessionSettingCategory.MessageRequests:
case SessionSettingCategory.RecoveryPhrase: case SessionSettingCategory.RecoveryPassword:
throw new Error(`no header for should be tried to be rendered for "${category}"`); throw new Error(`no header for should be tried to be rendered for "${category}"`);
default: default:

@ -1,20 +1,20 @@
import { from_hex, to_hex } from 'libsodium-wrappers-sumo';
import { crypto_sign_curve25519_pk_to_ed25519 } from 'curve25519-js'; import { crypto_sign_curve25519_pk_to_ed25519 } from 'curve25519-js';
import { from_hex, to_hex } from 'libsodium-wrappers-sumo';
import { cloneDeep, flatten, isEmpty, isEqual, isString, uniqBy } from 'lodash'; import { cloneDeep, flatten, isEmpty, isEqual, isString, uniqBy } from 'lodash';
import { getConversationController } from '../../../conversations';
import { LibSodiumWrappers } from '../../../crypto';
import { KeyPrefixType, PubKey } from '../../../types';
import { Data } from '../../../../data/data'; import { Data } from '../../../../data/data';
import { combineKeys, generateBlindingFactor } from '../../../utils/SodiumUtils';
import { OpenGroupData } from '../../../../data/opengroups'; import { OpenGroupData } from '../../../../data/opengroups';
import { ConversationModel } from '../../../../models/conversation';
import { UserUtils } from '../../../utils';
import { SogsBlinding } from './sogsBlinding';
import { fromHexToArray } from '../../../utils/String';
import { KNOWN_BLINDED_KEYS_ITEM } from '../../../../data/settings-key'; import { KNOWN_BLINDED_KEYS_ITEM } from '../../../../data/settings-key';
import { ConversationModel } from '../../../../models/conversation';
import { roomHasBlindEnabled } from '../../../../types/sqlSharedTypes'; import { roomHasBlindEnabled } from '../../../../types/sqlSharedTypes';
import { Storage } from '../../../../util/storage'; import { Storage } from '../../../../util/storage';
import { getConversationController } from '../../../conversations';
import { LibSodiumWrappers } from '../../../crypto';
import { KeyPrefixType, PubKey } from '../../../types';
import { UserUtils } from '../../../utils';
import { combineKeys, generateBlindingFactor } from '../../../utils/SodiumUtils';
import { fromHexToArray } from '../../../utils/String';
import { SogsBlinding } from './sogsBlinding';
export type BlindedIdMapping = { export type BlindedIdMapping = {
blindedId: string; blindedId: string;
@ -157,7 +157,7 @@ export function tryMatchBlindWithStandardKey(
const blindedIdNoPrefix = PubKey.removePrefixIfNeeded(PubKey.cast(blindedSessionId).key); const blindedIdNoPrefix = PubKey.removePrefixIfNeeded(PubKey.cast(blindedSessionId).key);
const kBytes = generateBlindingFactor(serverPubKey, sodium); const kBytes = generateBlindingFactor(serverPubKey, sodium);
// From the session id (ignoring 05 prefix) we have two possible ed25519 pubkeys; the first is // From the account id (ignoring 05 prefix) we have two possible ed25519 pubkeys; the first is
// the positive(which is what Signal's XEd25519 conversion always uses) // the positive(which is what Signal's XEd25519 conversion always uses)
const inbin = from_hex(sessionIdNoPrefix); const inbin = from_hex(sessionIdNoPrefix);

@ -267,7 +267,7 @@ const handleMessagesResponseV4 = async (
); );
const roomDetails: OpenGroupRequestCommonType = pick(roomInfos, 'serverUrl', 'roomId'); const roomDetails: OpenGroupRequestCommonType = pick(roomInfos, 'serverUrl', 'roomId');
// then we try to find matching real session ids with the blinded ids we have. // then we try to find matching real account ids with the blinded ids we have.
// this is where we override the blindedId with the real one in case we already know that user real sessionId // this is where we override the blindedId with the real one in case we already know that user real sessionId
const messagesWithResolvedBlindedIdsIfFound = []; const messagesWithResolvedBlindedIdsIfFound = [];

@ -103,7 +103,7 @@ async function getSessionIDForOnsName(onsNameCase: string) {
throw new Error('ONSresolve: Validation failed'); throw new Error('ONSresolve: Validation failed');
} }
// assert all the returned session ids are the same // assert all the returned account ids are the same
if (_.uniq(allResolvedSessionIds).length !== 1) { if (_.uniq(allResolvedSessionIds).length !== 1) {
throw new Error('ONSresolve: Validation failed'); throw new Error('ONSresolve: Validation failed');
} }

@ -134,7 +134,7 @@ export class PubKey {
// Check if it's hex // Check if it's hex
const isHex = pubkey.replace(/[\s]*/g, '').match(/^[0-9a-fA-F]+$/); const isHex = pubkey.replace(/[\s]*/g, '').match(/^[0-9a-fA-F]+$/);
if (!isHex) { if (!isHex) {
return window.i18n('invalidSessionId'); return window.i18n('invalidAccountId');
} }
// Check if the pubkey length is 33 and leading with 05 or of length 32 // Check if the pubkey length is 33 and leading with 05 or of length 32

@ -1,6 +1,10 @@
export type LocalizerKeys = export type LocalizerKeys =
| 'about' | 'about'
| 'accept' | 'accept'
| 'accountIDCopy'
| 'accountIdEnter'
| 'accountIdEnterYourFriends'
| 'accountIdYours'
| 'activeMembers' | 'activeMembers'
| 'add' | 'add'
| 'addACaption' | 'addACaption'
@ -8,7 +12,6 @@ export type LocalizerKeys =
| 'addModerator' | 'addModerator'
| 'addModerators' | 'addModerators'
| 'addingContacts' | 'addingContacts'
| 'allUsersAreRandomly...'
| 'anonymous' | 'anonymous'
| 'answeredACall' | 'answeredACall'
| 'appMenuHide' | 'appMenuHide'
@ -99,7 +102,6 @@ export type LocalizerKeys =
| 'contactsHeader' | 'contactsHeader'
| 'contextMenuNoSuggestions' | 'contextMenuNoSuggestions'
| 'continue' | 'continue'
| 'continueYourSession'
| 'conversationsHeader' | 'conversationsHeader'
| 'conversationsNone' | 'conversationsNone'
| 'conversationsSettingsTitle' | 'conversationsSettingsTitle'
@ -107,7 +109,6 @@ export type LocalizerKeys =
| 'copyErrorAndQuit' | 'copyErrorAndQuit'
| 'copyMessage' | 'copyMessage'
| 'copyOpenGroupURL' | 'copyOpenGroupURL'
| 'copySessionID'
| 'couldntFindServerMatching' | 'couldntFindServerMatching'
| 'create' | 'create'
| 'createClosedGroupNamePrompt' | 'createClosedGroupNamePrompt'
@ -116,7 +117,6 @@ export type LocalizerKeys =
| 'createConversationNewGroup' | 'createConversationNewGroup'
| 'createGroup' | 'createGroup'
| 'createPassword' | 'createPassword'
| 'createSessionID'
| 'databaseError' | 'databaseError'
| 'debugLog' | 'debugLog'
| 'debugLogExplanation' | 'debugLogExplanation'
@ -193,11 +193,7 @@ export type LocalizerKeys =
| 'enterNewLineDescription' | 'enterNewLineDescription'
| 'enterNewPassword' | 'enterNewPassword'
| 'enterPassword' | 'enterPassword'
| 'enterRecoveryPhrase'
| 'enterSendNewMessageDescription' | 'enterSendNewMessageDescription'
| 'enterSessionID'
| 'enterSessionIDOfRecipient'
| 'enterSessionIDOrONSName'
| 'entireAccount' | 'entireAccount'
| 'error' | 'error'
| 'establishingConnection' | 'establishingConnection'
@ -239,14 +235,13 @@ export type LocalizerKeys =
| 'imageCaptionIconAlt' | 'imageCaptionIconAlt'
| 'incomingCallFrom' | 'incomingCallFrom'
| 'incomingError' | 'incomingError'
| 'invalidAccountId'
| 'invalidGroupNameTooLong' | 'invalidGroupNameTooLong'
| 'invalidGroupNameTooShort' | 'invalidGroupNameTooShort'
| 'invalidNumberError'
| 'invalidOldPassword' | 'invalidOldPassword'
| 'invalidOpenGroupUrl' | 'invalidOpenGroupUrl'
| 'invalidPassword' | 'invalidPassword'
| 'invalidPubkeyFormat' | 'invalidPubkeyFormat'
| 'invalidSessionId'
| 'inviteContacts' | 'inviteContacts'
| 'join' | 'join'
| 'joinACommunity' | 'joinACommunity'
@ -273,7 +268,6 @@ export type LocalizerKeys =
| 'leaving' | 'leaving'
| 'leftTheGroup' | 'leftTheGroup'
| 'lightboxImageAlt' | 'lightboxImageAlt'
| 'linkDevice'
| 'linkPreviewDescription' | 'linkPreviewDescription'
| 'linkPreviewsConfirmMessage' | 'linkPreviewsConfirmMessage'
| 'linkPreviewsTitle' | 'linkPreviewsTitle'
@ -281,6 +275,7 @@ export type LocalizerKeys =
| 'linkVisitWarningTitle' | 'linkVisitWarningTitle'
| 'loadAccountProgressMessage' | 'loadAccountProgressMessage'
| 'loading' | 'loading'
| 'lockApp'
| 'mainMenuEdit' | 'mainMenuEdit'
| 'mainMenuFile' | 'mainMenuFile'
| 'mainMenuHelp' | 'mainMenuHelp'
@ -305,11 +300,13 @@ export type LocalizerKeys =
| 'messageDeletionForbidden' | 'messageDeletionForbidden'
| 'messageHash' | 'messageHash'
| 'messageInfo' | 'messageInfo'
| 'messageNewDescription'
| 'messageRequestAccepted' | 'messageRequestAccepted'
| 'messageRequestAcceptedOurs' | 'messageRequestAcceptedOurs'
| 'messageRequestAcceptedOursNoName' | 'messageRequestAcceptedOursNoName'
| 'messageRequestPending' | 'messageRequestPending'
| 'messageRequests' | 'messageRequests'
| 'messageRequestsAcceptDescription'
| 'messageWillDisappear' | 'messageWillDisappear'
| 'messagesHeader' | 'messagesHeader'
| 'moreInformation' | 'moreInformation'
@ -371,6 +368,7 @@ export type LocalizerKeys =
| 'onlyAdminCanRemoveMembers' | 'onlyAdminCanRemoveMembers'
| 'onlyAdminCanRemoveMembersDesc' | 'onlyAdminCanRemoveMembersDesc'
| 'onlyGroupAdminsCanChange' | 'onlyGroupAdminsCanChange'
| 'onsErrorNotRecognised'
| 'open' | 'open'
| 'openGroupInvitation' | 'openGroupInvitation'
| 'openGroupURL' | 'openGroupURL'
@ -381,8 +379,8 @@ export type LocalizerKeys =
| 'originalMessageNotFound' | 'originalMessageNotFound'
| 'otherPlural' | 'otherPlural'
| 'otherSingular' | 'otherSingular'
| 'password'
| 'passwordCharacterError' | 'passwordCharacterError'
| 'passwordCreate'
| 'passwordLengthError' | 'passwordLengthError'
| 'passwordTypeError' | 'passwordTypeError'
| 'passwordViewTitle' | 'passwordViewTitle'
@ -420,11 +418,11 @@ export type LocalizerKeys =
| 'readReceiptSettingDescription' | 'readReceiptSettingDescription'
| 'readReceiptSettingTitle' | 'readReceiptSettingTitle'
| 'received' | 'received'
| 'recoveryPasswordEnter'
| 'recoveryPasswordErrorMessageGeneric' | 'recoveryPasswordErrorMessageGeneric'
| 'recoveryPasswordErrorMessageIncorrect' | 'recoveryPasswordErrorMessageIncorrect'
| 'recoveryPasswordErrorMessageShort' | 'recoveryPasswordErrorMessageShort'
| 'recoveryPhrase' | 'recoveryPasswordWarningSendDescription'
| 'recoveryPhraseEmpty'
| 'recoveryPhraseSavePromptMain' | 'recoveryPhraseSavePromptMain'
| 'remove' | 'remove'
| 'removeAccountPasswordDescription' | 'removeAccountPasswordDescription'
@ -443,8 +441,6 @@ export type LocalizerKeys =
| 'requestsSubtitle' | 'requestsSubtitle'
| 'resend' | 'resend'
| 'resolution' | 'resolution'
| 'respondingToRequestWarning'
| 'restoreUsingRecoveryPhrase'
| 'ringing' | 'ringing'
| 'save' | 'save'
| 'saveLogToDesktop' | 'saveLogToDesktop'
@ -459,8 +455,6 @@ export type LocalizerKeys =
| 'selectMessage' | 'selectMessage'
| 'sendFailed' | 'sendFailed'
| 'sendMessage' | 'sendMessage'
| 'sendRecoveryPhraseMessage'
| 'sendRecoveryPhraseTitle'
| 'sending' | 'sending'
| 'sent' | 'sent'
| 'serverId' | 'serverId'
@ -481,8 +475,6 @@ export type LocalizerKeys =
| 'shareBugDetails' | 'shareBugDetails'
| 'show' | 'show'
| 'showDebugLog' | 'showDebugLog'
| 'showRecoveryPhrase'
| 'showRecoveryPhrasePasswordRequest'
| 'showUserDetails' | 'showUserDetails'
| 'someOfYourDeviceUseOutdatedVersion' | 'someOfYourDeviceUseOutdatedVersion'
| 'spellCheckDescription' | 'spellCheckDescription'
@ -493,7 +485,6 @@ export type LocalizerKeys =
| 'startConversation' | 'startConversation'
| 'startInTrayDescription' | 'startInTrayDescription'
| 'startInTrayTitle' | 'startInTrayTitle'
| 'startNewConversationBy...'
| 'startedACall' | 'startedACall'
| 'support' | 'support'
| 'surveyTitle' | 'surveyTitle'
@ -581,6 +572,7 @@ export type LocalizerKeys =
| 'viewMenuZoomOut' | 'viewMenuZoomOut'
| 'voiceMessage' | 'voiceMessage'
| 'waitOneMoment' | 'waitOneMoment'
| 'warning'
| 'welcomeToYourSession' | 'welcomeToYourSession'
| 'windowMenuClose' | 'windowMenuClose'
| 'windowMenuMinimize' | 'windowMenuMinimize'
@ -595,6 +587,4 @@ export type LocalizerKeys =
| 'youHaveANewFriendRequest' | 'youHaveANewFriendRequest'
| 'youLeftTheGroup' | 'youLeftTheGroup'
| 'youSetYourDisappearingMessages' | 'youSetYourDisappearingMessages'
| 'yourSessionID'
| 'yourUniqueSessionID'
| 'zoomFactorSettingTitle'; | 'zoomFactorSettingTitle';

@ -63,7 +63,7 @@ const generateKeypair = async (
}; };
/** /**
* Sign in with a recovery phrase. We won't try to recover an existing profile name * Sign in with a recovery password. We won't try to recover an existing profile name
* @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this. * @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this.
* @param mnemonicLanguage 'english' only is supported * @param mnemonicLanguage 'english' only is supported
* @param profileName the displayName to use for this user * @param profileName the displayName to use for this user
@ -77,7 +77,7 @@ export async function signInWithRecovery(
} }
/** /**
* Sign in with a recovery phrase and try to recover display name and avatar from the first encountered configuration message. * Sign in with a recovery password and try to recover display name and avatar from the first encountered configuration message.
* @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this. * @param mnemonic the mnemonic the user duly saved in a safe place. We will restore his sessionID based on this.
* @param mnemonicLanguage 'english' only is supported * @param mnemonicLanguage 'english' only is supported
* @param loadingAnimationCallback a callback to trigger a loading animation * @param loadingAnimationCallback a callback to trigger a loading animation

Loading…
Cancel
Save