diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9bf0d6f2d..40ec4b7fc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,7 +14,7 @@ Remember, you can preview this before saving it. ### Contributor checklist: - [ ] My commits are in nice logical chunks with [good commit messages](http://chris.beams.io/posts/git-commit/) -- [ ] My changes are [rebased](https://blog.axosoft.com/golden-rule-of-rebasing-in-git/) on the latest [`unstable`](https://github.com/session-foundation/session-desktop/tree/clearnet) branch +- [ ] My changes are [rebased](https://blog.axosoft.com/golden-rule-of-rebasing-in-git/) on the latest [`unstable`](https://github.com/session-foundation/session-desktop/tree/unstable) branch - [ ] A `yarn ready` run passes successfully ([more about tests here](https://github.com/session-foundation/session-desktop/blob/master/CONTRIBUTING.md#tests)) - [ ] My changes are ready to be shipped to users diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 83dd6a348..a929a7e82 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -8,13 +8,11 @@ on: push: branches: - master - - clearnet - unstable - 'release/**' - 'ci/**' pull_request: branches: - - clearnet - unstable - 'release/**' - 'ci/**' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40ec8e3d2..f04c2c6f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -239,10 +239,10 @@ So you wanna make a pull request? Please observe the following guidelines. - Please do not submit pull requests for pure translation fixes. Anyone can update the translations at [Crowdin](https://getsession.org/translate). - [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your - changes on the latest `clearnet` branch, resolving any conflicts. + changes on the latest `unstable` branch, resolving any conflicts. This ensures that your changes will merge cleanly when you open your PR. - Be sure to add and run tests! -- Make sure the diff between `clearnet` and your branch contains only the +- Make sure the diff between `unstable` and your branch contains only the minimal set of changes needed to implement your feature or bugfix. This will make it easier for the person reviewing your code to approve the changes. Please do not submit a PR with commented out code or unfinished features. @@ -262,6 +262,7 @@ So you wanna make a pull request? Please observe the following guidelines. choices that may be helpful to someone reviewing or auditing the commit history in the future. When in doubt, err on the side of a longer commit message. + Above all, spend some time with the repository. Follow the pull request template added to your pull request description automatically. Take a look at recent approved pull requests, see how they did things. diff --git a/README.md b/README.md index 9c85f87f6..718925d94 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Please search for any [existing issues](https://github.com/session-foundation/se ## Supported platforms -Session requires Windows 10 or later, macOS Monterey (12) or later, or a Linux distribution with glibc 2.28 or later like Debian 10 or Ubuntu 20.04. +Session requires Windows 10 or later, macOS Ventura (13) or later, or a Linux distribution with glibc 2.28 or later like Debian 10 or Ubuntu 20.04. ## Build instruction @@ -32,7 +32,7 @@ gpg --import KeeJef.asc Get the signed hash for this release, the SESSION_VERSION needs to be updated for the release you want to verify ``` -export SESSION_VERSION=1.6.1 +export SESSION_VERSION=1.15.0 wget https://github.com/session-foundation/session-desktop/releases/download/v$SESSION_VERSION/signatures.asc ``` diff --git a/THEMES.md b/THEMES.md index 37a98dfc2..86e82a95c 100644 --- a/THEMES.md +++ b/THEMES.md @@ -23,7 +23,7 @@ Session doesn't support custom theming yet but it's pretty easy to add a new the [Here](https://github.com/yougotwill/session-desktop/pull/19) is an example PR for the `Windows Crash` theme which was inspired by the classic [blue screen of death](https://user-images.githubusercontent.com/14887287/203880658-e4a768d7-1b25-45d2-9e6d-00b233eb84a8.png). -Keep in mind that if you swap back to the latest `clearnet` with the `Windows Crash` theme set it may cause a database issue. So when you change your branch back make sure to set your theme to one of the [available themes](#available-themes) above. +Keep in mind that if you swap back to the latest `unstable` with the `Windows Crash` theme set it may cause a database issue. So when you change your branch back make sure to set your theme to one of the [available themes](#available-themes) above. ### Screenshot diff --git a/ts/components/registration/stages/CreateAccount.tsx b/ts/components/registration/stages/CreateAccount.tsx index 05c04e9e3..4b8feae32 100644 --- a/ts/components/registration/stages/CreateAccount.tsx +++ b/ts/components/registration/stages/CreateAccount.tsx @@ -33,6 +33,8 @@ import { resetRegistration } from '../RegistrationStages'; import { ContinueButton, OnboardDescription, OnboardHeading } from '../components'; import { BackButtonWithinContainer } from '../components/BackButton'; import { displayNameIsValid, sanitizeDisplayNameOrToast } from '../utils'; +import { localize } from '../../../util/i18n/localizedString'; +import { RetrieveDisplayNameError } from '../../../session/utils/errors'; export type AccountDetails = { recoveryPassword: string; @@ -106,9 +108,15 @@ export const CreateAccount = () => { `[onboarding] create account: signUpWithDetails failed! Error: ${err.message || String(err)}` ); dispatch(setAccountCreationStep(AccountCreation.DisplayName)); - // Note: we have to assume here that libsession threw an error because the name was too long. + + if (err instanceof RetrieveDisplayNameError) { + dispatch(setDisplayNameError(localize('displayNameErrorDescription').toString())); + return; + } + + // Note: we have to assume here that libsession threw an error because the name was too long since we covered the other cases. // The error reported by libsession is not localized - dispatch(setDisplayNameError(window.i18n('displayNameErrorDescriptionShorter'))); + dispatch(setDisplayNameError(localize('displayNameErrorDescriptionShorter').toString())); } }; diff --git a/ts/components/registration/stages/RestoreAccount.tsx b/ts/components/registration/stages/RestoreAccount.tsx index d006287b0..d995efaa1 100644 --- a/ts/components/registration/stages/RestoreAccount.tsx +++ b/ts/components/registration/stages/RestoreAccount.tsx @@ -6,7 +6,7 @@ import { InvalidWordsError, NotEnoughWordsError } from '../../../session/crypto/ import { ProfileManager } from '../../../session/profile_manager/ProfileManager'; import { PromiseUtils } from '../../../session/utils'; import { TaskTimedOutError } from '../../../session/utils/Promise'; -import { NotFoundError } from '../../../session/utils/errors'; +import { NotFoundError, RetrieveDisplayNameError } from '../../../session/utils/errors'; import { trigger } from '../../../shims/events'; import { AccountRestoration, @@ -43,6 +43,7 @@ import { BackButtonWithinContainer } from '../components/BackButton'; import { useRecoveryProgressEffect } from '../hooks'; import { displayNameIsValid, sanitizeDisplayNameOrToast } from '../utils'; import { AccountDetails } from './CreateAccount'; +import { localize } from '../../../util/i18n/localizedString'; type AccountRestoreDetails = AccountDetails & { dispatch: Dispatch; abortSignal?: AbortSignal }; @@ -197,9 +198,14 @@ export const RestoreAccount = () => { ); dispatch(setAccountRestorationStep(AccountRestoration.DisplayName)); - // Note: we have to assume here that libsession threw an error because the name was too long. + if (err instanceof RetrieveDisplayNameError) { + dispatch(setDisplayNameError(localize('displayNameErrorDescription').toString())); + return; + } + + // Note: we have to assume here that libsession threw an error because the name was too long since we covered the other cases. // The error reported by libsession is not localized - dispatch(setDisplayNameError(window.i18n('displayNameErrorDescriptionShorter'))); + dispatch(setDisplayNameError(localize('displayNameErrorDescriptionShorter').toString())); } }; diff --git a/ts/session/profile_manager/ProfileManager.ts b/ts/session/profile_manager/ProfileManager.ts index 25d7b305d..4ebae7194 100644 --- a/ts/session/profile_manager/ProfileManager.ts +++ b/ts/session/profile_manager/ProfileManager.ts @@ -6,6 +6,7 @@ import { SyncUtils, UserUtils } from '../utils'; import { fromHexToArray, sanitizeSessionUsername, toHex } from '../utils/String'; import { AvatarDownload } from '../utils/job_runners/jobs/AvatarDownloadJob'; import { CONVERSATION_PRIORITIES, ConversationTypeEnum } from '../../models/types'; +import { RetrieveDisplayNameError } from '../utils/errors'; export type Profile = { displayName: string | undefined; @@ -114,9 +115,7 @@ async function updateOurProfileDisplayNameOnboarding(newName: string) { const appliedName = await UserConfigWrapperActions.getName(); if (isNil(appliedName)) { - throw new Error( - 'updateOurProfileDisplayNameOnboarding failed to retrieve name after setting it' - ); + throw new RetrieveDisplayNameError(); } return appliedName; @@ -142,7 +141,7 @@ async function updateOurProfileDisplayName(newName: string) { await UserConfigWrapperActions.setNameTruncated(sanitizeSessionUsername(newName).trim()); const truncatedName = await UserConfigWrapperActions.getName(); if (isNil(truncatedName)) { - throw new Error('updateOurProfileDisplayName: failed to get truncated displayName back'); + throw new RetrieveDisplayNameError(); } await UserConfigWrapperActions.setPriority(dbPriority); if (dbProfileUrl && !isEmpty(dbProfileKey)) { diff --git a/ts/session/utils/errors.ts b/ts/session/utils/errors.ts index 4115157e2..6e365ac8e 100644 --- a/ts/session/utils/errors.ts +++ b/ts/session/utils/errors.ts @@ -87,3 +87,10 @@ export class SnodeResponseError extends BaseError { super(message); } } +export class RetrieveDisplayNameError extends Error { + constructor(message = 'failed to retrieve display name after setting it') { + super(message); + // restore prototype chain + Object.setPrototypeOf(this, SnodeResponseError.prototype); + } +}