User sent messages like:
- "deadline is friday at 2PM"
- "Homework is due saturday at 1PM"
But no deadline is being created.
Check for: 🚨 DEADLINE: Extracting deadline from message:
If this log is MISSING, it means the extraction function is not being called at all.
Possible reasons:
- Message sender is not current user (only sender extracts deadlines after Bug #1 fix)
- Message listener not firing
- Task block not executing
Check for: ✅ No deadline indicators found. Skipping GPT-4.
If you see this, the message is being rejected by the keyword pre-filter.
Current keywords checked:
DEADLINE_KEYWORDS = [
'deadline', 'due', 'submit', 'turn in', 'by', 'before',
'no later than', 'expires', 'ends', 'finish', 'complete'
];Issue: User messages have "deadline" and "due" keywords, so this should NOT be the issue.
Check for: ❌ Cloud Function ERROR:
If you see this, the Cloud Function is being called but failing.
Check for: ❌ Failed to parse due date:
If you see this, the date string from GPT-4 is malformed.
Check for: ℹ️ No deadline detected in message
If you see this, GPT-4 determined the message doesn't contain a deadline.
Look for: 🚨 DEADLINE: Extracting deadline from message:
- If YES: Continue to Step 2
- If NO: See "Extraction Not Being Called" section below
Look for: 📤 AIService: Calling Cloud Function for deadline extraction
- If YES: Continue to Step 3
- If NO: Extraction started but didn't reach Cloud Function call
Look for: 📦 Raw response from Cloud Function:
What to check:
- Is
detected: trueordetected: false? - Is there a
deadlineobject withtitle,dueDate, etc.?
Look for: ✅ Cloud Function SUCCESS!
- If YES: Extraction succeeded, check Firestore
- If NO: Check for parsing errors
Add this to the top of handleFirestoreMessages to confirm messages are being received:
print("🚨 DEADLINE: 📨 Message received: \(firebaseMessage.text)")
print("🚨 DEADLINE: Sender: \(firebaseMessage.senderId)")
print("🚨 DEADLINE: Current user: \(currentUserId)")
print("🚨 DEADLINE: Will extract? \(firebaseMessage.senderId == currentUserId)")Change line 345 from:
if firebaseMessage.senderId == currentUserId {To:
if true { // TEMP: Extract for all messagesThis will help diagnose if the sender check is the issue.
The keyword filter might be case-sensitive. Try sending:
- "Deadline is Friday at 2PM" (capital D)
- "Due Friday at 2PM" (just "due")
Go to Firebase Console → Functions → Logs
Look for recent processAI function calls. Check if they show:
- Message text received
detectDeadlinebeing called- GPT-4 response
- Any errors
🚨 DEADLINE: Extracting deadline from message: msg123
📤 AIService: Calling Cloud Function for deadline extraction
Message: deadline is friday at 2PM...
📦 Raw response from Cloud Function:
Keys: [confidence, deadline, detected, method, ...]
Full data: {detected: 1, deadline: {...}, ...}
✅ Cloud Function SUCCESS!
- Title: Deadline
- Due: 2025-10-24 14:00:00
- Priority: high
✅ Updated message AIMetadata with deadline in Firestore
🔄 Update received - 1 documents from Firestore
📄 Parsing document: deadline123
✅ Parsed: Deadline - Due: 2025-10-24 14:00:00
✅ Updated UI state - 1 active deadlines
Send this exact message (it has very obvious deadline indicators):
DEADLINE: Submit report by Friday 2PM
- Open Xcode console
- Filter for "DEADLINE:"
- Look for the first log:
Extracting deadline from message - Follow the log trail to see where it stops
Tell me:
- Do you see "Extracting deadline from message"? YES / NO
- If NO, do you see ANY logs with "DEADLINE:" after sending? YES / NO
- If YES, what's the last "DEADLINE:" log you see?
- Any errors with "❌" or "ERROR"?
This will help me pinpoint exactly where the issue is!