summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Lytvynov <awly@tailscale.com>2023-10-19 13:53:44 -0700
committerAndrew Lytvynov <awly@tailscale.com>2023-10-19 15:06:49 -0700
commit9827e6965acedb99fc06f9867290e17bb09ff7e4 (patch)
treee5ed81f6445fd1bb331946de0d1d0731ea5361b1
parent1df2d14c8f3f46921c9c42e292c609726e87db47 (diff)
downloadtailscale-awly/ipnlocal-watchnotifications-clientversion.tar.xz
tailscale-awly/ipnlocal-watchnotifications-clientversion.zip
ipn/ipnlocal: send ClientVersion in initial WatchNotifications messageawly/ipnlocal-watchnotifications-clientversion
If ClientVersion was populated before WatchNotifications started, it would never get delivered to the caller. Explicitly include it. Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
-rw-r--r--ipn/ipnlocal/local.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go
index 96bb69a6f..4ace95b0d 100644
--- a/ipn/ipnlocal/local.go
+++ b/ipn/ipnlocal/local.go
@@ -2117,8 +2117,12 @@ func (b *LocalBackend) WatchNotifications(ctx context.Context, mask ipn.NotifyWa
ini.BrowseToURL = ptr.To(b.authURLSticky)
}
}
+ prefs := b.sanitizedPrefsLocked()
if mask&ipn.NotifyInitialPrefs != 0 {
- ini.Prefs = ptr.To(b.sanitizedPrefsLocked())
+ ini.Prefs = ptr.To(prefs)
+ }
+ if prefs.Valid() && prefs.AutoUpdate().Check {
+ ini.ClientVersion = b.lastClientVersion
}
if mask&ipn.NotifyInitialNetMap != 0 {
ini.NetMap = b.netMap