SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: simplify changelog fetching logic and enhance version display interactivity (#8432)
Abhi kumar7d5e14abb61f
diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsxindex bd61cc3e95..9938c48000 100644--- a/frontend/src/container/AppLayout/index.tsx+++ b/frontend/src/container/AppLayout/index.tsx@@ -63,7 +63,6 @@ import {} from 'types/api/licensesV3/getActive';import AppReducer from 'types/reducer/app';import { USER_ROLES } from 'types/roles';-import { checkVersionState } from 'utils/app';import { eventEmitter } from 'utils/getEventEmitter';import {getFormattedDate,@@ -98,16 +97,11 @@ function AppLayout(props: AppLayoutProps): JSX.Element {const [showSlowApiWarning, setShowSlowApiWarning] = useState(false);const [slowApiWarningShown, setSlowApiWarningShown] = useState(false);- const [shouldFetchChangelog, setShouldFetchChangelog] = useState<boolean>(- false,- );- const { currentVersion, latestVersion } = useSelector<AppState, AppReducer>(+ const { latestVersion } = useSelector<AppState, AppReducer>((state) => state.app,);- const isLatestVersion = checkVersionState(currentVersion, latestVersion);-const handleBillingOnSuccess = (data: SuccessResponseV2<CheckoutSuccessPayloadProps>,): void => {@@ -163,7 +157,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {queryFn: (): Promise<SuccessResponse<ChangelogSchema> | ErrorResponse> =>getChangelogByVersion(latestVersion),queryKey: ['getChangelogByVersion', latestVersion],- enabled: isLoggedIn && !isCloudUserVal && shouldFetchChangelog,+ enabled: isLoggedIn && !isCloudUserVal && Boolean(latestVersion),},]);@@ -223,7 +217,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {if (getUserVersionResponse.isFetched &&- getUserLatestVersionResponse.isSuccess &&+ getUserVersionResponse.isSuccess &&getUserVersionResponse.data &&getUserVersionResponse.data.payload) {@@ -261,18 +255,13 @@ function AppLayout(props: AppLayoutProps): JSX.Element {getUserVersionResponse.isLoading,getUserVersionResponse.isError,getUserVersionResponse.data,+ getUserVersionResponse.isSuccess,getUserLatestVersionResponse.isFetched,getUserVersionResponse.isFetched,getUserLatestVersionResponse.isSuccess,notifications,]);- useEffect(() => {- if (!isLatestVersion) {- setShouldFetchChangelog(true);- }- }, [isLatestVersion]);-useEffect(() => {if (getChangelogByVersionResponse.isFetched &&diff --git a/frontend/src/container/SideNav/SideNav.styles.scss b/frontend/src/container/SideNav/SideNav.styles.scssindex 339c300770..aad45823f9 100644--- a/frontend/src/container/SideNav/SideNav.styles.scss+++ b/frontend/src/container/SideNav/SideNav.styles.scss@@ -112,9 +112,6 @@font-weight: 500;line-height: 14px; /* 140% */letter-spacing: 0.4px;-- cursor: pointer;-max-width: 60px;overflow: hidden;@@ -122,6 +119,10 @@white-space: nowrap;}+ .version-clickable {+ cursor: pointer;+ }+.version-update-notification-dot-icon {width: 4px;height: 4px;diff --git a/frontend/src/container/SideNav/SideNav.tsx b/frontend/src/container/SideNav/SideNav.tsxindex d31a114276..27f653d59c 100644--- a/frontend/src/container/SideNav/SideNav.tsx+++ b/frontend/src/container/SideNav/SideNav.tsx@@ -734,12 +734,12 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {};const onClickVersionHandler = useCallback((): void => {- if (isCloudUser) {+ if (isCloudUser || !changelog) {return;}setShowChangelogModal(true);- }, [isCloudUser]);+ }, [isCloudUser, changelog]);useEffect(() => {if (!isLatestVersion && !isCloudUser) {@@ -807,7 +807,10 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {}><div className="version-container">- <span className="version" onClick={onClickVersionHandler}>+ <span+ className={cx('version', changelog && 'version-clickable')}+ onClick={onClickVersionHandler}+ >{currentVersion}</span>