Here's a bug that's easy to miss and harder to debug: your AI runs perfectly on one input path, silently does nothing on another, and there's no error — just missing results. I hit this recently in an on-device inspection app. The flow is straightforward: capture a photo (camera or photo library), run AI hazard detection, overlay bounding boxes, trigger violation alerts if needed. Camera captures worked great. Gallery picks saved the photo fine. But no bounding boxes appeared, no alerts fired. The AI was just... not running. What Actually Happened Here's the stripped-down structure: // Camera capture handler const handleRequestCapture = async ( uri : string ) => { await savePhoto ( uri ); await detectAndSave ( uri ); // ✅ AI runs checkViolationAlerts (); }; // Library pick handler const handleLibraryPick = async ( uri : string ) => { await savePhoto ( uri ); // ❌ detectAndSave was never called }; Enter fullscreen mode Exit fullscreen mode The library path was added later, modelled on the save logic but…