diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 1220b122..4449f6c9 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -13,7 +13,7 @@ jobs: run: npm ci - name: Check types - run: npm run typecheck + run: npm run check:types - name: Lint with Biome run: npm run check:code diff --git a/package.json b/package.json index 76af1218..86ed0acd 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "lint:styles:fix": "stylelint **/*.{scss,css} --fix", "preview": "vite preview", "start": "vite", - "typecheck": "tsc --noEmit", - "typecheck:watch": "tsc --noEmit --watch" + "check:types": "tsc --noEmit", + "check:types:watch": "tsc --noEmit --watch" }, "dependencies": { "form-data": "4.0.0", diff --git a/src/components/Nav/AuthModal/LoginForm.tsx b/src/components/Nav/AuthModal/LoginForm.tsx index 83d89917..c7a26d68 100644 --- a/src/components/Nav/AuthModal/LoginForm.tsx +++ b/src/components/Nav/AuthModal/LoginForm.tsx @@ -97,7 +97,12 @@ export const LoginForm = () => { const { errors } = await signIn({ email: email(), password: password() }) console.error('[signIn errors]', errors) if (errors?.length > 0) { - if (errors.some((error) => error.message.includes('bad user credentials'))) { + if ( + errors.some( + (error) => + error.message.includes('bad user credentials') || error.message.includes('user not found'), + ) + ) { setValidationErrors((prev) => ({ ...prev, password: t('Something went wrong, check email and password'), diff --git a/src/components/Nav/AuthModal/SendResetLinkForm.tsx b/src/components/Nav/AuthModal/SendResetLinkForm.tsx index e872cbeb..57f55b6d 100644 --- a/src/components/Nav/AuthModal/SendResetLinkForm.tsx +++ b/src/components/Nav/AuthModal/SendResetLinkForm.tsx @@ -61,7 +61,12 @@ export const SendResetLinkForm = () => { redirect_uri: window.location.origin, }) console.debug('[SendResetLinkForm] authorizer response:', data) - if (errors?.some((error) => error.message.includes('bad user credentials'))) { + if ( + errors?.some( + (error) => + error.message.includes('bad user credentials') || error.message.includes('user not found'), + ) + ) { setIsUserNotFound(true) } if (data.message) setMessage(data.message) diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index 5d3cdd31..a0c273fc 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -57,6 +57,7 @@ export const HeaderAuth = (props: Props) => { toggleEditorPanel() } + // FIXME: use or remove const handleSaveClick = () => { const hasTopics = form.selectedTopics?.length > 0 if (hasTopics) { @@ -110,7 +111,13 @@ export const HeaderAuth = (props: Props) => {
-
+ - -
+ + - } - > -
- + + diff --git a/src/components/Topic/TopicBadge/TopicBadge.tsx b/src/components/Topic/TopicBadge/TopicBadge.tsx index 73afe366..fa7e577b 100644 --- a/src/components/Topic/TopicBadge/TopicBadge.tsx +++ b/src/components/Topic/TopicBadge/TopicBadge.tsx @@ -48,7 +48,7 @@ export const TopicBadge = (props: Props) => { lang() === 'en' ? capitalize(props.topic.slug.replaceAll('-', ' ')) : props.topic.title return ( -
+
diff --git a/src/graphql/query/core/my-followed.ts b/src/graphql/query/core/my-followed.ts deleted file mode 100644 index f33808fd..00000000 --- a/src/graphql/query/core/my-followed.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { gql } from '@urql/core' - -export default gql` - query MySubscriptionsQuery { - get_my_followed { - topics { - id - title - body - slug - } - authors { - id - name - slug - pic - created_at - } - communities { - id - name - slug - pic - created_at - } - } - } -` diff --git a/src/renderer/_default.page.client.tsx b/src/renderer/_default.page.client.tsx index fff76e88..8b74aca6 100644 --- a/src/renderer/_default.page.client.tsx +++ b/src/renderer/_default.page.client.tsx @@ -1,7 +1,7 @@ import type { PageContextBuiltInClientWithClientRouting } from 'vike/types' import type { PageContext } from './types' -// import * as Sentry from '@sentry/browser' +import { init as SentryInit, replayIntegration } from '@sentry/browser' import i18next from 'i18next' import HttpApi from 'i18next-http-backend' import ICU from 'i18next-icu' @@ -9,7 +9,7 @@ import { hydrate } from 'solid-js/web' import { App } from '../components/App' import { initRouter } from '../stores/router' -// import { SENTRY_DSN } from '../utils/config' +import { GLITCHTIP_DSN } from '../utils/config' import { resolveHydrationPromise } from '../utils/hydrationPromise' let layoutReady = false @@ -20,13 +20,16 @@ export const render = async (pageContext: PageContextBuiltInClientWithClientRout const { pathname, search } = window.location const searchParams = Object.fromEntries(new URLSearchParams(search)) initRouter(pathname, searchParams) - /* - if (SENTRY_DSN) { - Sentry.init({ - dsn: SENTRY_DSN, - }) - } - */ + + SentryInit({ + dsn: GLITCHTIP_DSN, + tracesSampleRate: 0.01, + integrations: [replayIntegration()], + // Session Replay + replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. + replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + }) + // eslint-disable-next-line import/no-named-as-default-member await i18next .use(HttpApi) diff --git a/src/utils/config.ts b/src/utils/config.ts index cfc2f7fa..41710c83 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -5,6 +5,7 @@ export const cdnUrl = 'https://cdn.discours.io' export const thumborUrl = import.meta.env.PUBLIC_THUMBOR_URL || defaultThumborUrl export const SENTRY_DSN = import.meta.env.PUBLIC_SENTRY_DSN || '' +export const GLITCHTIP_DSN = import.meta.env.PUBLIC_GLITCHTIP_DSN || '' const defaultSearchUrl = 'https://search.discours.io' export const searchUrl = import.meta.env.PUBLIC_SEARCH_URL || defaultSearchUrl