Bugfix: Session 179: Why is Vitto desktop always showing 'Offline' i...

Documentation for Sessions

🐛 Bugfix: Session 179: Why is Vitto desktop always showing 'Offline' i...

Date: 2026-03-06
Time: 15:57:10 UTC
Session: gspace1-179.4
Agent: angular
Confidence: 98%
Status: ✅ Documented


📋 Decision Context

Question:

Session 179: Why is Vitto desktop always showing 'Offline' in production builds — even when production APIs are up?

Task: Fix Vitto desktop offline status in production


🎯 Decision Made

Chosen:

Added isTauriOrigin() check to shared cors.factory.ts that allows 'tauri://localhost' and 'https://tauri.localhost' origins unconditionally, same pattern as isCapacitorOrigin() and isChromeExtensionOrigin().

Options Considered:

  1. Add tauri://localhost to ALLOWED_ORIGINS env var on Railway
  2. Add isTauriOrigin() to shared CORS factory (chosen)
  3. Disable CORS entirely for Tauri builds via CSP changes
  4. Use a proxy server in the Tauri shell to avoid CORS

💭 Reasoning

Root cause: Tauri v2 production builds serve the Angular app from 'tauri://localhost' origin (not http://localhost). The shared CORS factory's isLocalhostOrigin() only matches http://localhost: and http://127.0.0.1: — the tauri:// scheme was never handled. Every HTTP request from the desktop app to production backends (ai-api.gograb.space) was silently blocked by CORS preflight failure. The ApiConnectivityService health check failed → status = 'offline'. This is identical to the Capacitor origin issue solved in Session 177 (capacitor://localhost). The fix follows the exact same pattern: unconditional origin check before the allowedOrigins list, so no env var needed on Railway. Early warning signal: any new native platform wrapper (Electron, etc.) will need its own origin check added here.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation