test(startup): expose startup performance marks and clear cache on auth loss
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

Marks splash/session/render/home timings in production as well, and drops cached home data when the session is rejected.
This commit is contained in:
1xDed committed 2026-11-28 17:30:39 +03:00
1 parent 6a1467e864
commit e5f1ff34ed
3 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ const SplashHider = () => {
// The effect runs after React committed the app shell; the static
// splash has done its job and can fade out immediately.
splash.classList.add("hidden");
if (import.meta.env.DEV) performance.mark("blink:splash-hidden");
performance.mark("blink:splash-hidden");
const timer = window.setTimeout(() => splash.remove(), 260);
return () => window.clearTimeout(timer);
}, []);
+6
View File
@@ -11,6 +11,7 @@ import {
} from "./utils/store/api";
import { CentralProvider, useCentralStore } from "./utils/store/central";
import {
clearPersistedQueryCache,
persistQueryCache,
restoreQueryCache,
} from "./utils/queryCachePersistence";
@@ -90,6 +91,8 @@ function ProviderWrapper() {
// Only an actual authorization failure should log the user out.
if (status !== 401 && status !== 403) return;
await delUser();
queryClient.clear();
clearPersistedQueryCache();
createApi(api.basePath, undefined);
router.navigate({
to: "/login/manual",
@@ -122,6 +125,7 @@ function ProviderWrapper() {
}
const init = async () => {
performance.mark("blink:init-start");
// Frameless titlebar: macOS keeps the native traffic lights; Windows and
// Linux use the custom window buttons in the header.
const userAgent = navigator.userAgent;
@@ -145,6 +149,7 @@ const init = async () => {
});
const { api: initialApi, user: initialUser } = await initializeApi();
performance.mark("blink:session-restored");
const owner =
initialApi?.basePath && initialUser?.Id
@@ -172,6 +177,7 @@ const init = async () => {
</QueryClientProvider>
</React.StrictMode>,
);
performance.mark("blink:react-render");
};
init();
-1
View File
@@ -179,7 +179,6 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
}, []);
useEffect(() => {
if (!import.meta.env.DEV) return;
if (!libraries.data || !latestMedia.data) return;
performance.mark("blink:home-ready");
}, [libraries.data, latestMedia.data]);