Remove temporary perf state debug instrumentation

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
Cursor AgentandJulius Marminge committed 2026-02-17 05:53:55 +00:00
1 parent 9c956c0320
commit 2344506597
2 files changed
+1 -29

No files matched your search

@@ -409,7 +409,6 @@ async function seedRendererState(
const script = `
(() => {
const key = "t3code:renderer-state:v7";
localStorage.setItem("t3code:perf-debug", "1");
localStorage.setItem("t3code:perf-bootstrap-skip", "1");
localStorage.setItem(key, JSON.stringify(${JSON.stringify(state)}));
let projects = -1;
+1 -28
View File
@@ -100,8 +100,6 @@ const initialState: AppState = {
function readPersistedState(): AppState {
if (typeof window === "undefined") return initialState;
const perfDebugEnabled = window.localStorage.getItem("t3code:perf-debug") === "1";
try {
const rawCurrent = window.localStorage.getItem(PERSISTED_STATE_KEY);
const legacyValues = LEGACY_PERSISTED_STATE_KEYS.map((key) => window.localStorage.getItem(key));
@@ -110,27 +108,10 @@ function readPersistedState(): AppState {
if (!raw) return initialState;
const rawCodethingV1 = window.localStorage.getItem("codething:renderer-state:v1");
const hydrated = hydratePersistedState(raw, !rawCurrent && raw === rawCodethingV1);
if (!hydrated) {
if (perfDebugEnabled) {
console.info("[perf-debug] hydratePersistedState returned null", {
rawLength: raw.length,
hasCurrent: rawCurrent !== null,
});
}
return initialState;
}
if (perfDebugEnabled) {
console.info("[perf-debug] hydrated persisted state", {
projects: hydrated.projects.length,
threads: hydrated.threads.length,
});
}
if (!hydrated) return initialState;
return { ...hydrated, diffOpen: false };
} catch {
if (perfDebugEnabled) {
console.info("[perf-debug] readPersistedState threw; falling back to initial state");
}
return initialState;
}
}
@@ -139,14 +120,6 @@ function persistState(state: AppState): void {
if (typeof window === "undefined") return;
try {
const perfDebugEnabled = window.localStorage.getItem("t3code:perf-debug") === "1";
if (perfDebugEnabled) {
console.info("[perf-debug] persistState", {
projects: state.projects.length,
threads: state.threads.length,
activeThreadId: state.activeThreadId,
});
}
window.localStorage.setItem(PERSISTED_STATE_KEY, JSON.stringify(toPersistedState(state)));
for (const legacyKey of LEGACY_PERSISTED_STATE_KEYS) {
window.localStorage.removeItem(legacyKey);