Bugfix: Should VittoScreenCaptureService connect to /local-bridge in...

Documentation for Sessions

🐛 Bugfix: Should VittoScreenCaptureService connect to /local-bridge in...

Date: 2026-03-26
Time: 18:43:37 UTC
Session: gspace1-273.8
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Should VittoScreenCaptureService connect to /local-bridge in browser environments, given that local-bridge is a desktop/Tauri-only feature and every browser user triggers an infinite reconnection loop to a non-existent gateway?

Task: S273: Guard VittoScreenCaptureService.connect() to Tauri-only


🎯 Decision Made

Chosen:

Guard connect() with isTauri check: if (!this.isTauri) return. The service already has an isTauri getter. The local-bridge WebSocket namespace handles screen capture, page actions, and local commands — all of which require Tauri native APIs. Browser users get zero value from this connection but pay the cost of infinite reconnection attempts to vitto-api.gograb.space every 60 seconds.

Options Considered:


💭 Reasoning

Root cause: VittoChatEngineService calls screenCapture.connect(userId) unconditionally for all authenticated users. But VittoScreenCaptureService's entire purpose is Tauri desktop integration — screen capture via html2canvas is the only browser-applicable feature, and even that is only useful when Vitto's backend requests it through the local-bridge. No backend will ever request screen capture from a browser user through the local-bridge.

The isTauri check is the correct guard because: (a) The service already has the getter. (b) The capabilities list already branches on isTauri (Tauri gets 14 capabilities, browser gets 2). (c) The alternative — checking if the backend is deployed — would require an HTTP preflight that adds latency and complexity.

What would make this wrong: If we later want browser-based screen sharing through the local-bridge (e.g., for remote desktop support). In that case, the guard would need to be changed to check a feature flag rather than isTauri. But that's a deliberate feature addition, not a regression.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation