Architecture: How should notification preferences be auto-configured for W...

Documentation for Sessions

🏗️ Architecture: How should notification preferences be auto-configured for W...

Date: 2026-03-13
Time: 00:09:52 UTC
Session: gspace1-210.7
Agent: architecture
Confidence: 93%
Status: ✅ Documented


📋 Decision Context

Question:

How should notification preferences be auto-configured for WhatsApp users to achieve zero-friction Jarvis setup?

Task: S210.4: Auto-setup notification prefs for WhatsApp Jarvis loop


🎯 Decision Made

Chosen:

Auto-create UserNotificationPrefs on first message from a linked WhatsApp user, using the same progressive-onboarding pattern as the magic link account linking flow. When accountLinked=true and no prefs exist, ensureNotificationPrefs() auto-creates with preferredChannel='whatsapp', channelId=phone, sends one-time confirmation message. Never runs again once prefs exist.

Options Considered:

  1. Option A: Require manual API call (curl/UI) to set notification preferences
  2. Option B: Auto-create prefs on first message from linked channel user (same pattern as magic link)
  3. Option C: Create a settings page in Vitto frontend for users to configure preferences

💭 Reasoning

Option B replicates the proven magic link pattern that already exists in the codebase: detect state → auto-create record with safe defaults → send one-time confirmation → allow user to override. The key insight is that when a WhatsApp user has already linked their account (verified=true), we KNOW their phone number — creating notification prefs is just connecting dots we already have. Option A (manual curl) would mean every user needs an admin to configure them. Option C (settings page) is good for power users but doesn't solve day-one experience. Option B gives zero-friction defaults while Options A/C can be added later for customization. Root cause: The dispatcher was working but had no recipients because no one had configured notification preferences yet — the channel was wired but the address book was empty.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation