Apologies again if I’ve missed something in the docs.
As I menioned previously, I’m writing a silly wrapper UI. I’m hoping to expose nearby devices to the user in a way that makes it (perhaps cartoonishly) easy for them to connect 2 devices without using the Syncthing GUI.
As far as I can tell, Syncthing’s Discovery API only announces devices it has seen. There doesn’t seem to be a way to know which discovered devices are no longer visible. Syncthing knows when a remote device is “disconnected”; is there a way to find this out through the API without adding the device first? If not, is the cleanest alternative to try to connect to the device, or is there another way to determine that the device is unavailable, via Syncthing’s state?
Indeed, you get the discovery cache but it doesn’t contain the fields like when the entry was last seen. We could probably add that, or maybe just not return old entries.
That would be cool! If this is something under consideration, it seems like the additional data (when the entry was last seen) would be preferable to removing the entries entirely? Even if an entry is disconnected, it’s still possible to add that device locally, as far as I can tell.
Most of the time when someone is adding a remote device, both would be visible to each other, but the fact that it’s possible to add a device and have the remote device notified only once they are both visible to one another is kind of neat?
Let me know if I’ve misunderstood the stage changes that occur here, though.