fix(console-noise): pre-warm via auth.getSession + demote stuck crypto-migration logs to debug
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -213,7 +213,7 @@ async function runLegacyMigration(
|
||||
}
|
||||
}
|
||||
|
||||
console.info(
|
||||
console.debug(
|
||||
'[crypto-migration] vault scan:',
|
||||
'serverDevices=' + report.serverDevices,
|
||||
'keysFromServerList=' + report.strongholdKeysFromServerDevices,
|
||||
|
||||
Reference in New Issue
Block a user