fix: memory leak in SSR caused by global tracking (#1582)

This commit is contained in:
Kristaps Fabians Geikins
2025-01-09 21:10:11 +02:00
committed by GitHub
parent 8a5f424e2e
commit b57f2befe3
@@ -27,6 +27,15 @@ export function getCurrentTracking () {
}
let tracking: LoadingTracking
if (isServer) {
// SSR does not support onScopeDispose, so if we don't skip this, it will leak memory
tracking = {
queries: ref(0),
mutations: ref(0),
subscriptions: ref(0),
}
return { tracking }
}
if (!globalTracking.components.has(currentScope)) {
// Add per-component tracking