Skip to content

Conversation

@edgarpavlovsky
Copy link
Member

This pull request contains changes generated by a Cursor Cloud Agent

Open in Cursor Open in Web

Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>
@cursor
Copy link

cursor bot commented Oct 30, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mallory Ready Ready Preview Comment Oct 30, 2025 10:16am

Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>
Copy link

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments:

apps/client/hooks/useChatState.ts (lines 31-50):
Unused code remains after disabling the proactive message feature. The markUserOnboardingComplete function and hasTriggeredProactiveMessage ref are no longer called or used since their only references were in the now-disabled useEffect.

View Details
📝 Patch Details
diff --git a/apps/client/hooks/useChatState.ts b/apps/client/hooks/useChatState.ts
index a1d67ea..edde50a 100644
--- a/apps/client/hooks/useChatState.ts
+++ b/apps/client/hooks/useChatState.ts
@@ -24,32 +24,6 @@ type StreamState =
   | { status: 'reasoning'; startTime: number }
   | { status: 'responding'; startTime: number }
 
-/**
- * Mark user as having completed onboarding
- * This is a one-time flag to prevent infinite loops of intro messages
- */
-async function markUserOnboardingComplete(userId: string): Promise<boolean> {
-  try {
-    console.log('🎯 [Onboarding] Marking user onboarding as complete for userId:', userId);
-    
-    const { error } = await supabase
-      .from('users')
-      .update({ has_completed_onboarding: true })
-      .eq('id', userId);
-    
-    if (error) {
-      console.error('❌ [Onboarding] Failed to update has_completed_onboarding:', error);
-      return false;
-    }
-    
-    console.log('✅ [Onboarding] Successfully marked onboarding as complete');
-    return true;
-  } catch (err) {
-    console.error('❌ [Onboarding] Exception updating onboarding flag:', err);
-    return false;
-  }
-}
-
 export function useChatState({ currentConversationId, userId, walletBalance, userHasCompletedOnboarding }: UseChatStateProps) {
   // Transaction guard for Grid session validation
   const { ensureGridSession } = useTransactionGuard();
@@ -60,7 +34,6 @@ export function useChatState({ currentConversationId, userId, walletBalance, use
   // Supporting state for UI
   const [liveReasoningText, setLiveReasoningText] = useState('');
   const [pendingMessage, setPendingMessage] = useState<string | null>(null); // Preserve message during OTP
-  const hasTriggeredProactiveMessage = useRef(false);
 
   // AI Chat using Vercel's useChat hook
   const aiChatResult = useAIChat({

Analysis

Unused code remains after disabling proactive message feature in useChatState.ts

What fails: markUserOnboardingComplete function (lines 31-50) and hasTriggeredProactiveMessage ref (line 63) are declared but unused after the proactive message useEffect was disabled

How to reproduce:

  1. Search codebase for markUserOnboardingComplete - only found in disabled useEffect block (line 252)
  2. Search codebase for hasTriggeredProactiveMessage - only found in disabled useEffect block (lines 218, 247)
  3. Verify useEffect is commented out in block comment (lines 196-278)

Result: Dead code clutters codebase with unused function and ref declaration

Expected: Unused declarations should be removed when their only consumers are disabled to maintain clean codebase

@edgarpavlovsky edgarpavlovsky merged commit 778175b into main Oct 30, 2025
14 checks passed
edgarpavlovsky added a commit that referenced this pull request Nov 8, 2025
* feat: Disable proactive message for onboarding

Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>

* feat: Disable proactive message feature

Co-authored-by: edgarpavlovsky <edgarpavlovsky@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants