fix(console-noise): pre-warm via auth.getSession + demote stuck crypto-migration logs to debug

This commit is contained in:
byGalax
2026-05-17 01:43:53 +02:00
parent c9a64bf898
commit 49855c5d3f
3 changed files with 30 additions and 12 deletions
+6 -1
View File
@@ -207,9 +207,14 @@ export function AuthProvider({ children }: { children: ReactNode }) {
// Pre-warm Supabase: fires the first round-trip in the background so the
// first user-triggered query (e.g. loading conversations) doesn't pay
// the cold-connection latency.
//
// Uses auth.getSession() instead of a `profiles` SELECT because the
// SELECT race-fired before the supabase client committed its JWT to
// request headers, causing a 400 from PostgREST on app boot. Auth
// endpoints don't depend on RLS and tolerate the race.
useEffect(() => {
if (!session) return;
void supabase.from('profiles').select('id').limit(1).then(() => undefined);
void supabase.auth.getSession();
}, [session]);
// Phase 3: ensure this install owns exactly one devices row. The row is
+1 -1
View File
@@ -213,7 +213,7 @@ async function runLegacyMigration(
}
}
console.info(
console.debug(
'[crypto-migration] vault scan:',
'serverDevices=' + report.serverDevices,
'keysFromServerList=' + report.strongholdKeysFromServerDevices,