From 27e0c178d305214edd48dcfc6054520a22a4f5d0 Mon Sep 17 00:00:00 2001 From: attemka Date: Fri, 8 Sep 2023 15:29:35 +0200 Subject: [PATCH 1/4] Raised the heap size for atlas docker build (#4831) Co-authored-by: Artem --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4bc5093da7..a6e3680508 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,8 @@ on: jobs: atlas: runs-on: ubuntu-latest + env: + NODE_OPTIONS: "--max_old_space_size=4096" steps: - name: Login to DockerHub uses: docker/login-action@v1 From 0b32d0d072012f372d6bda53a9b23efb09649573 Mon Sep 17 00:00:00 2001 From: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:20:10 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=94=A5=20Hotfix=20for=20account=20cre?= =?UTF-8?q?ation=20(#4855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add new error * Try to create session if its not present on request --- .../_auth/SignUpModal/SignUpModal.tsx | 19 +++++++++++++++++++ packages/atlas/src/hooks/useCreateMember.ts | 5 +++++ .../src/providers/auth/auth.provider.tsx | 9 --------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx index fbf8651e5b..4271592367 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx @@ -11,6 +11,7 @@ import { AccountFormData, FaucetError, MemberFormData, RegisterError, useCreateM import { useMediaMatch } from '@/hooks/useMediaMatch' import { useSegmentAnalytics } from '@/hooks/useSegmentAnalytics' import { useUniqueMemberHandle } from '@/hooks/useUniqueMemberHandle' +import { handleAnonymousAuth } from '@/providers/auth/auth.helpers' import { useAuthStore } from '@/providers/auth/auth.store' import { useSnackbar } from '@/providers/snackbars' import { useYppStore } from '@/providers/ypp/ypp.store' @@ -59,9 +60,11 @@ export const SignUpModal = () => { const [amountOfTokens, setAmountofTokens] = useState() const memberRef = useRef(null) const memberPollingTries = useRef(0) + const haveTriedCreateSession = useRef(false) const ytResponseData = useYppStore((state) => state.ytResponseData) const setYppModalOpenName = useYppStore((state) => state.actions.setYppModalOpenName) const setYtResponseData = useYppStore((state) => state.actions.setYtResponseData) + const { anonymousUserId } = useAuthStore() const { displaySnackbar } = useSnackbar() const ytEmailIsValid = Boolean(ytResponseData?.email && !ytResponseData.email.includes('@pages.plusgoogle.com')) @@ -131,6 +134,21 @@ export const SignUpModal = () => { }) setAuthModalOpenName(undefined) } + if (error === RegisterError.SessionRequired) { + if (!haveTriedCreateSession.current) { + haveTriedCreateSession.current = true + handleAnonymousAuth(anonymousUserId).then(() => { + handleOrionAccountCreation() + }) + } else { + displaySnackbar({ + title: 'Something went wrong', + description: 'We could not create or find session. Please contact support.', + iconType: 'error', + }) + setAuthModalOpenName(undefined) + } + } }, onStart: () => { goToStep(SignUpSteps.Creating) @@ -148,6 +166,7 @@ export const SignUpModal = () => { }, }) }, [ + anonymousUserId, createNewOrionAccount, displaySnackbar, goToNextStep, diff --git a/packages/atlas/src/hooks/useCreateMember.ts b/packages/atlas/src/hooks/useCreateMember.ts index 58b21f4f46..82e5c26db2 100644 --- a/packages/atlas/src/hooks/useCreateMember.ts +++ b/packages/atlas/src/hooks/useCreateMember.ts @@ -70,6 +70,7 @@ export enum RegisterError { EmailAlreadyExists = 'EmailAlreadyExists', UnknownError = 'UnknownError', MembershipNotFound = 'MembershipNotFound', + SessionRequired = 'SessionRequired', } type SignUpParams = { @@ -241,9 +242,13 @@ export const useCreateMember = () => { 'To create new membership you need to use an email that is not connected to already existing account.', }) onError?.(RegisterError.EmailAlreadyExists) + return } else if (errorMessage.startsWith('Membership not found by id')) { onError?.(RegisterError.MembershipNotFound) return + } else if (errorMessage.startsWith("cookie 'session_id' required")) { + onError?.(RegisterError.SessionRequired) + return } else { displaySnackbar({ title: 'Something went wrong', diff --git a/packages/atlas/src/providers/auth/auth.provider.tsx b/packages/atlas/src/providers/auth/auth.provider.tsx index 4df318459e..82bd8c97a3 100644 --- a/packages/atlas/src/providers/auth/auth.provider.tsx +++ b/packages/atlas/src/providers/auth/auth.provider.tsx @@ -1,4 +1,3 @@ -import { useApolloClient } from '@apollo/client' import { u8aToHex } from '@polkadot/util' import { cryptoWaitReady } from '@polkadot/util-crypto' import { isAxiosError } from 'axios' @@ -39,7 +38,6 @@ export const AuthProvider: FC = ({ children }) => { const [lazyCurrentAccountQuery, { refetch }] = useGetCurrentAccountLazyQuery() const { setApiActiveAccount } = useJoystream() const { identifyUser, trackLogout } = useSegmentAnalytics() - const client = useApolloClient() const { anonymousUserId, encodedSeed, @@ -56,13 +54,6 @@ export const AuthProvider: FC = ({ children }) => { const { data } = await lazyCurrentAccountQuery() if (!data) { handleAnonymousAuth(anonymousUserId).then((userId) => { - client.refetchQueries({ - include: 'active', - onQueryUpdated: (observableQuery) => { - // don't refetch GetBasicVideos query, as it's a duplicate of GetBasicVideosLightweight - return observableQuery.queryName !== 'GetBasicVideos' - }, - }) setAnonymousUserId(userId ?? null) }) setIsAuthenticating(false) From bc934adb34e047cc77e2bf35e1fb6dfd738473d9 Mon Sep 17 00:00:00 2001 From: attemka Date: Thu, 14 Sep 2023 09:46:56 +0200 Subject: [PATCH 3/4] YPP\signup minor fixes (#4863) * minor ypp\signup fixes * removed inline styling * removed unused subtitleIcon --------- Co-authored-by: Artem --- packages/atlas/atlas.config.yml | 4 ++-- .../components/_auth/SignUpModal/SignUpModal.tsx | 3 +-- .../SignUpSteps/SignUpCreatingMemberStep.tsx | 16 +++++++++++++++- .../SignUpSteps/SignUpSteps.styles.ts | 6 ++++++ .../YppDashboard/tabs/YppDashboardMainTab.tsx | 4 ---- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/packages/atlas/atlas.config.yml b/packages/atlas/atlas.config.yml index 6747cf8548..0f0da3f5ec 100644 --- a/packages/atlas/atlas.config.yml +++ b/packages/atlas/atlas.config.yml @@ -43,12 +43,12 @@ features: landingPageOgImgPath: null # Path to the open graph image for the YPP landing page - if not set, the default image will be used googleConsoleClientId: '$VITE_GOOGLE_CONSOLE_CLIENT_ID' youtubeSyncApiUrl: '$VITE_YOUTUBE_SYNC_API_URL' - suspensionReasonsLink: https://www.notion.so/joystream/YouTube-Partner-Program-Outline-d492c2eb88ff4ace955b5f2902ec21fb?pvs=4#e03bb48ed7f7480c8896a908f63f2594 # Link with explanation what might be the reason of ypp channel suspension + suspensionReasonsLink: https://joystream.notion.site/My-channel-is-suspended-what-to-do-86a3df16c55c434ab2184d61dfcfc41b # Link with explanation what might be the reason of ypp channel suspension suspendedSupportLink: https://discord.com/channels/811216481340751934/1053294778529353788 # Link that will be displayed for users suspended in YPP suspendedLinkText: '#ypp-support channel on our Discord server' youtubeCollaboratorMemberId: '$VITE_YOUTUBE_COLLABORATOR_MEMBER_ID' enrollmentReward: 5000 # Amount for successful enrollment in YPP in joystream.tokenTicker units. - enrollmentUsdReward: 20 # Amount for successful enrollment in YPP in USD. + enrollmentUsdReward: 5 # Amount for successful enrollment in YPP in USD. referralBaseReward: 2.5 # Self-explanatory, it should match `baseUsdAmount.min` value in last `rewards` entry tiersDefinition: # Tiers for YouTube partner program rewards. You can provide maximum three tiers. Each tier should has own multiplier. tiers: diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx index 4271592367..b1aa641dc3 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx @@ -66,7 +66,6 @@ export const SignUpModal = () => { const setYtResponseData = useYppStore((state) => state.actions.setYtResponseData) const { anonymousUserId } = useAuthStore() const { displaySnackbar } = useSnackbar() - const ytEmailIsValid = Boolean(ytResponseData?.email && !ytResponseData.email.includes('@pages.plusgoogle.com')) const { generateUniqueMemberHandleBasedOnInput } = useUniqueMemberHandle() @@ -399,7 +398,7 @@ export const SignUpModal = () => { isOverflowing={overflow || !smMatch} isEmailAlreadyTakenError={emailAlreadyTakenError} onEmailSubmit={handleEmailStepSubmit} - email={signUpFormData.current.email || (ytEmailIsValid ? (ytResponseData?.email as string) : '')} + email={signUpFormData.current.email} confirmedTerms={signUpFormData.current.confirmedTerms} /> )} diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx index ed3381d960..1a6c4c13e1 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpCreatingMemberStep.tsx @@ -1,5 +1,8 @@ import { FC, useEffect } from 'react' +import { SvgAlertsWarning24 } from '@/assets/icons' +import { WarningContainer } from '@/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles' + import { SignUpStepsCommonProps } from './SignUpSteps.types' import { AuthenticationModalStepTemplate } from '../../AuthenticationModalStepTemplate' @@ -16,7 +19,18 @@ export const SignUpCreatingMemberStep: FC = ({ setPrimar return ( + Please wait while your membership is being created. Our faucet server will create it for you so you don't need + to worry about any fees. This may take up to 1 minute on a slow network. +
+
+ + + Please do not close the browser tab or reload the page. + + + } loader hasNavigatedBack={hasNavigatedBack} /> diff --git a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts index f457f81e4f..1fc30796b4 100644 --- a/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts +++ b/packages/atlas/src/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles.ts @@ -21,3 +21,9 @@ export const StyledLink = styled.a` color: ${cVar('colorTextPrimary')}; text-decoration: underline; ` + +export const WarningContainer = styled.span` + display: flex; + justify-content: flex-start; + align-items: center; +` diff --git a/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx b/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx index 545ec7b7f3..24bdcea48f 100644 --- a/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx +++ b/packages/atlas/src/views/studio/YppDashboard/tabs/YppDashboardMainTab.tsx @@ -46,10 +46,6 @@ export const YppDashboardMainTab: FC = ({ currentTier - . If you have questions, we are happy to help in our{' '} - . } From 5923eecd9e18e3ac0f607d8c6b3520175090a304 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 14 Sep 2023 12:50:42 +0200 Subject: [PATCH 4/4] changelog and version bump --- CHANGELOG.md | 11 +++++++++++ packages/atlas/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6996b2ba3c..33de2c8aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.9.1] - 2023-09-14 + +### Changed + +- Removed YPP email pre-population +- Minor text changes in signup modal + +### Fixed + +- Fixed bug with missing anonymousId on signup + ## [4.9.0] - 2023-09-08 ### Added diff --git a/packages/atlas/package.json b/packages/atlas/package.json index 474459d7b8..d0750b8fb2 100644 --- a/packages/atlas/package.json +++ b/packages/atlas/package.json @@ -1,7 +1,7 @@ { "name": "@joystream/atlas", "description": "UI for consuming Joystream - a user governed video platform", - "version": "4.9.0", + "version": "4.9.1", "license": "GPL-3.0", "scripts": { "start": "vite",