From 87dc3e08373e0b6e63dc293ecbef176031ea416f Mon Sep 17 00:00:00 2001 From: Matt Gilham <7717048+mgilham@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:28:13 -0800 Subject: [PATCH] fix: don't expect /licenses to work for oss query service (#6763) --- frontend/src/AppRoutes/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/AppRoutes/index.tsx b/frontend/src/AppRoutes/index.tsx index 5875a31d879..3b58eb18a91 100644 --- a/frontend/src/AppRoutes/index.tsx +++ b/frontend/src/AppRoutes/index.tsx @@ -227,6 +227,10 @@ function App(): JSX.Element { } }, [user, isFetchingUser, isCloudUserVal, enableAnalytics]); + const isOss = featureFlags?.some( + (flag) => flag.name === FeatureKeys.OSS && flag.active, + ); + // if the user is in logged in state if (isLoggedInState) { if (pathname === ROUTES.HOME_PAGE) { @@ -241,7 +245,7 @@ function App(): JSX.Element { // this needs to be on top of data missing error because if there is an error, data will never be loaded and it will // move to indefinitive loading if ( - (userFetchError || licensesFetchError) && + (userFetchError || (licensesFetchError && featureFlags && !isOss)) && // oss query service does not have licenses API pathname !== ROUTES.SOMETHING_WENT_WRONG ) { history.replace(ROUTES.SOMETHING_WENT_WRONG);