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