feat: Add production-safe logging for avatar debugging

This commit is contained in:
gpt-engineer-app[bot]
2025-10-13 16:57:29 +00:00
parent f5d059b5a5
commit 8b1758e5e9
2 changed files with 15 additions and 2 deletions

View File

@@ -83,6 +83,17 @@ export function AuthButtons() {
</> </>
); );
} }
// Debug logging for avatar rendering
console.log('[AuthButtons] Component render:', {
hasUser: !!user,
hasProfile: !!profile,
hasAvatarUrl: !!profile?.avatar_url,
avatarUrl: profile?.avatar_url,
displayName: profile?.display_name,
username: profile?.username,
loading
});
return <DropdownMenu> return <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button variant="ghost" className="relative h-8 w-8 rounded-full"> <Button variant="ghost" className="relative h-8 w-8 rounded-full">

View File

@@ -73,11 +73,13 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
// Success - update state and complete // Success - update state and complete
if (isMountedRef.current) { if (isMountedRef.current) {
authLog('[Auth] Profile loaded:', { // Always log profile loading (production-safe)
console.log('[Auth] ✅ Profile loaded:', {
userId: data?.user_id, userId: data?.user_id,
username: data?.username, username: data?.username,
avatar_url: data?.avatar_url, avatar_url: data?.avatar_url,
avatar_image_id: data?.avatar_image_id avatar_image_id: data?.avatar_image_id,
hasData: !!data
}); });
setProfile(data as Profile); setProfile(data as Profile);
profileRetryCountRef.current = 0; profileRetryCountRef.current = 0;