From a6b7c214c338dd581a301c843ba7e090cb3c73c1 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 1 Oct 2025 00:53:49 +0000 Subject: [PATCH] Remove local fallback in createInitialProfile cgen-a4aa9cf9f3fe404fb3436bdebb61bd7f --- client/lib/aethex-database-adapter.ts | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 42a09b35..d6e587b4 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -280,24 +280,9 @@ export const aethexUserService = { if (error) { if (isTableMissing(error)) { - // Fallback to local profile storage when DB is not migrated - console.warn('user_profiles table missing during createInitialProfile - using local fallback'); - const fallback: AethexUserProfile = { - id: userId, - username: profileData.username || `user_${Date.now()}`, - full_name: profileData.full_name || profileData.username || `user_${Date.now()}`, - user_type: (profileData as any).user_type || "community_member", - experience_level: (profileData as any).experience_level || "beginner", - level: 1, - total_xp: 0, - loyalty_points: 0, - created_at: new Date().toISOString(), - updated_at: new Date().toISOString(), - } as AethexUserProfile; - try { - localStorage.setItem(`demo_profile_${userId}`, JSON.stringify(fallback)); - } catch {} - return fallback; + throw new Error( + 'Supabase table "user_profiles" is missing. Please run the required migrations.', + ); } throw error; } @@ -606,7 +591,7 @@ export const aethexAchievementService = { if (achievement) { aethexToast.aethex({ title: "Achievement Unlocked! 🎉", - description: `${achievement.icon || "��"} ${achievement.name} - ${achievement.description}`, + description: `${achievement.icon || "🏅"} ${achievement.name} - ${achievement.description}`, duration: 8000, }); await this.updateUserXPAndLevel(userId, achievement.xp_reward);