diff --git a/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts b/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts index bd60f9c62e9..a7fda28fd9d 100644 --- a/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts +++ b/packages/twenty-front/src/modules/auth/hooks/useIsLogged.ts @@ -1,8 +1,7 @@ import { tokenPairState } from '@/auth/states/tokenPairState'; -import { isValidAuthTokenPair } from '@/apollo/utils/isValidAuthTokenPair'; import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState'; export const useIsLogged = (): boolean => { const [tokenPair] = useAtomState(tokenPairState); - return isValidAuthTokenPair(tokenPair); + return !!tokenPair; }; diff --git a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx index ab17af1e821..b2b9a250c94 100644 --- a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx +++ b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx @@ -38,7 +38,13 @@ export const SentryInitEffect = () => { init({ environment: sentryConfig?.environment ?? undefined, - release: sentryConfig?.release ?? undefined, + // Prefer the build-time bundle version over the server-provided + // release tag. The server reports its own runtime version, which + // masks stale-bundle mismatches in Sentry error reports. + release: + process.env.REACT_APP_BUNDLE_VERSION ?? + sentryConfig?.release ?? + undefined, dsn: sentryConfig?.dsn, integrations: [ browserTracingIntegration({}), diff --git a/packages/twenty-front/vite.config.ts b/packages/twenty-front/vite.config.ts index 0c5f55010b3..f34aa647818 100644 --- a/packages/twenty-front/vite.config.ts +++ b/packages/twenty-front/vite.config.ts @@ -31,6 +31,7 @@ export default defineConfig(({ command, mode }) => { SSL_KEY_PATH, REACT_APP_PORT, IS_DEBUG_MODE, + APP_VERSION, } = env; const port = isNonEmptyString(REACT_APP_PORT) @@ -252,6 +253,7 @@ export default defineConfig(({ command, mode }) => { REACT_APP_SERVER_BASE_URL, IS_DEBUG_MODE, IS_DEV_ENV: mode === 'development' ? 'true' : 'false', + REACT_APP_BUNDLE_VERSION: APP_VERSION, }, }, css: {