From ece0ef48a1ee6860738f5cf4840dfa13369f8c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Gren=C3=A4ngen?= Date: Mon, 9 Feb 2026 20:38:14 +0100 Subject: [PATCH 1/2] Potential fix for odd devices showing in tailnet. Issue #106 --- src/models/TailDeviceInfo.h | 15 +++++++++++++++ src/models/TailStatus.h | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/models/TailDeviceInfo.h b/src/models/TailDeviceInfo.h index 827b77c..0243878 100644 --- a/src/models/TailDeviceInfo.h +++ b/src/models/TailDeviceInfo.h @@ -61,6 +61,8 @@ class TailDeviceInfo final : public QObject QString os{}; QString curAddr{}; QString relay{}; + QDateTime created {}; + QDateTime lastSeen {}; QList tailscaleIPs{}; QList allowedIPs{}; QList tags{}; @@ -93,6 +95,8 @@ class TailDeviceInfo final : public QObject , addrs(other.addrs) , curAddr(other.curAddr) , relay(other.relay) + , created(other.created) + , lastSeen(other.lastSeen) , online(other.online) , exitNode(other.exitNode) , exitNodeOption(other.exitNodeOption) @@ -120,6 +124,8 @@ class TailDeviceInfo final : public QObject addrs = other.addrs; curAddr = other.curAddr; relay = other.relay; + created = other.created; + lastSeen = other.lastSeen; online = other.online; exitNode = other.exitNode; exitNodeOption = other.exitNodeOption; @@ -173,6 +179,15 @@ class TailDeviceInfo final : public QObject self.exitNodeOption = jsonReadBool(obj, "ExitNodeOption"); self.online = jsonReadBool(obj, "Online"); self.active = jsonReadBool(obj, "Active"); + self.relay = jsonReadString(obj, "Relay"); + + // Try to parse created + auto createdStr = jsonReadString(obj, "Created"); + self.created = QDateTime::fromString(createdStr, Qt::DateFormat::ISODateWithMs); + + // And try to parse last seen + auto lastSeenStr = jsonReadString(obj, "LastSeen"); + self.lastSeen = QDateTime::fromString(lastSeenStr, Qt::DateFormat::ISODateWithMs); if (obj.contains("KeyExpiry") && !obj["KeyExpiry"].isNull()) { self.keyExpiry = QDateTime::fromString(obj["KeyExpiry"].toString(), Qt::DateFormat::ISODate); diff --git a/src/models/TailStatus.h b/src/models/TailStatus.h index 1e30e00..fcc4d56 100644 --- a/src/models/TailStatus.h +++ b/src/models/TailStatus.h @@ -145,7 +145,19 @@ class TailStatus final : public QObject if (child.isNull()) { continue; } - newStatus.peers.push_back(TailDeviceInfo::parse(child.toObject())); + auto dev = TailDeviceInfo::parse(child.toObject()); + + // NOTE: If the created date is way back in time something is off, this has been reported + // by users. For more info: + // See issue https://github.com/SneWs/tail-tray/issues/106 + if (dev.created.date().year() < 2020) { + // Don't track expired or invalid devices that should be of no interest to the user + // From the issue above we can see some odd dates like 1973-01 so it's not unix epoc either... + // So I just picked a year before Tailscale was funded/started for now... please + // correct this if you can figure out why this happens on some users tailnets. + continue; + } + newStatus.peers.push_back(dev); } } From 00e0712c9ebef8dc895ad05dac3fa599b9b4247f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Gren=C3=A4ngen?= Date: Mon, 9 Feb 2026 20:51:35 +0100 Subject: [PATCH 2/2] Make sure to filter out devices lacking a dns name --- src/models/TailStatus.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/models/TailStatus.h b/src/models/TailStatus.h index fcc4d56..526b823 100644 --- a/src/models/TailStatus.h +++ b/src/models/TailStatus.h @@ -150,6 +150,11 @@ class TailStatus final : public QObject // NOTE: If the created date is way back in time something is off, this has been reported // by users. For more info: // See issue https://github.com/SneWs/tail-tray/issues/106 + if (dev.dnsName.isEmpty() || dev.dnsName.length() < 2) { + // If no valid dns name, we ignore it... + continue; + } + if (dev.created.date().year() < 2020) { // Don't track expired or invalid devices that should be of no interest to the user // From the issue above we can see some odd dates like 1973-01 so it's not unix epoc either...