mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-04 04:34:07 +09:00
state, change: send the last seen time in the offline patch
As SaaS, on every offline patch and no online one. Peers otherwise show no last-seen time until the next full map. SaaS sends a coarser time; the exact one here is deliberate. Updates #3626
This commit is contained in:
1 parent
5083d77731
commit
ef6d033d19
13 files changed
+101
-28
No files matched your search
@@ -1487,9 +1487,8 @@ func (nv NodeView) TailNode(
|
||||
Expired: nv.IsExpired(),
|
||||
}
|
||||
|
||||
// Set LastSeen only for offline nodes to avoid confusing Tailscale clients
|
||||
// during rapid reconnection cycles. Online nodes should not have LastSeen set
|
||||
// as this can make clients interpret them as "not online" despite Online=true.
|
||||
// Only an offline entry has LastSeen, as on Tailscale SaaS. An online peer
|
||||
// can still show one on a client, which keeps it through an online patch.
|
||||
if nv.LastSeen().Valid() && nv.IsOnline().Valid() && !nv.IsOnline().Get() {
|
||||
lastSeen := nv.LastSeen().Get()
|
||||
tNode.LastSeen = &lastSeen
|
||||
|
||||
Reference in new issue
Block a user