perf(P6A.T5): pre-warm Supabase + avatar loading hints
Fire a no-await profiles query in AuthContext on session establish to absorb cold-connection latency before the first user-triggered request. Add loading='lazy' default to the central Avatar component so all off-screen avatars (chat list, friends list, popovers, message senders) skip eager Supabase Storage fetches; set loading='eager' on ConversationHeader (active conv header) and CallParticipantTile inline imgs (both AudioContent and VideoStub) which are always above-the-fold when visible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,14 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
void registerWebPush(installId);
|
||||
}, [session]);
|
||||
|
||||
// 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.
|
||||
useEffect(() => {
|
||||
if (!session) return;
|
||||
void supabase.from('profiles').select('id').limit(1).then(() => undefined);
|
||||
}, [session]);
|
||||
|
||||
// Phase 3: ensure this install owns exactly one devices row. The row is
|
||||
// pure session-list telemetry — it does not carry any cryptographic
|
||||
// material since the per-user-key refactor. We re-use the row across
|
||||
|
||||
Reference in New Issue
Block a user