ipn/ipnlocal: send ClientVersion in initial WatchNotifications message

If ClientVersion was populated before WatchNotifications started, it
would never get delivered to the caller. Explicitly include it.

Signed-off-by: Andrew Lytvynov <[email protected]>
This commit is contained in:
Andrew Lytvynov committed 2023-10-19 15:06:49 -07:00
1 parent 1df2d14c8f
commit 9827e6965a
1 file changed
+5 -1
+5 -1
View File
@@ -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