exo icon indicating copy to clipboard operation
exo copied to clipboard

fix local network warning

Open samiamjidkhan opened this issue 2 months ago • 3 comments

Motivation

Local network warning banner was showing on fresh install even though mDNS was working. The check would fail before the user had a chance to grant permission via the macOS prompt.

Changes

  • Added hasWorkedBefore flag persisted in UserDefaults
  • Only show warning if permission previously worked but now doesn't

Why It Works

On fresh install, the check may fail (no permission yet), but hasWorkedBefore is false so no warning shows. Once the user grants permission and a check succeeds, we record it. Future failures (zombie permission after restart) will show the warning since hasWorkedBefore is now true.

Test Plan

Manual Testing

Please test a new app build with this change @AlexCheema

Automated Testing

N/A

samiamjidkhan avatar Jan 12 '26 19:01 samiamjidkhan

Also please run nix flake check and nix fmt

AlexCheema avatar Jan 12 '26 20:01 AlexCheema

Could there be a bug causing the message to show more often? I've granted local network access on all of my nodes, but after restarting them I run into the message. When the message shows the nodes are unable to discover each other. I'm constantly going back and turning local network access on and off after restarting my nodes - it kind of defats the purpose of opening the application on startup. Sometimes it just requires me restart EXO to get things working again.

lucasajackson avatar Jan 14 '26 05:01 lucasajackson

The changes introduce a 30-second timeout on first launch to allow enough time for the system permission prompt to appear and for the user to respond, while subsequent launches use a shorter 3-second timeout to provide quicker feedback. On a fresh install, the 30-second timeout ensures the user has sufficient time to click “Allow”, preventing false warnings. If the user explicitly selects “Don't Allow”, the app still waits up to 30 seconds, after which the connection fails and a warning is correctly shown.

This approach is the most practical solution imo because macOS does not provide any API to detect whether the permission prompt is currently displayed or what choice the user made; the only observable signal is the connection result, so timing is used to reliably handle both scenarios.

samiamjidkhan avatar Jan 14 '26 07:01 samiamjidkhan

Could there be a bug causing the message to show more often? I've granted local network access on all of my nodes, but after restarting them I run into the message. When the message shows the nodes are unable to discover each other. I'm constantly going back and turning local network access on and off after restarting my nodes - it kind of defats the purpose of opening the application on startup. Sometimes it just requires me restart EXO to get things working again.

Hi, the general issue is tracked in #952. As we don't know how to fix it, we're adding better detection to at least inform the user that's something gone wrong in the short term. This improves that detection.

The fundamental issue is much more annoying. It's quite easy to reproduce, but we can't figure out what about our app structure is causing this permission to show as approved when it's not. Or why turning it off and on again works.

Any debugging/input on the main issue would be appreciated!

JakeHillion avatar Jan 16 '26 09:01 JakeHillion