diff options
| author | Andrew Lytvynov <awly@tailscale.com> | 2023-10-19 13:53:44 -0700 |
|---|---|---|
| committer | Andrew Lytvynov <awly@tailscale.com> | 2023-10-19 15:06:49 -0700 |
| commit | 9827e6965acedb99fc06f9867290e17bb09ff7e4 (patch) | |
| tree | e5ed81f6445fd1bb331946de0d1d0731ea5361b1 | |
| parent | 1df2d14c8f3f46921c9c42e292c609726e87db47 (diff) | |
| download | tailscale-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.go | 6 |
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 |
