fixestailscale/corp#26369
The suggested exit node is currently only calculated during a localAPI request.
For older UIs, this wasn't a bad choice - we could just fetch it on-demand when a menu
presented itself. For newer incarnations however, this is an always-visible field
that needs to react to changes in the suggested exit node's value.
This change recalculates the suggested exit node ID on netmap updates and
broadcasts it on the IPN bus. The localAPI version of this remains intact for the
time being.
Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
NotifyRateLimitNotifyWatchOpt=1<<8// if set, rate limit spammy netmap updates to every few seconds
NotifyHealthActionsNotifyWatchOpt=1<<9// if set, include PrimaryActions in health.State. Otherwise append the action URL to the text
NotifyInitialSuggestedExitNodeNotifyWatchOpt=1<<10// if set, the first Notify message (sent immediately) will contain the current SuggestedExitNode if available
)
// Notify is a communication from a backend (e.g. tailscaled) to a frontend
@ -98,7 +100,7 @@ type Notify struct {
// This field is only set in the first message when requesting
// NotifyInitialState. Clients must store it on their side as
// following notifications will not include this field.
SessionIDstring`json:",omitempty"`
SessionIDstring`json:",omitzero"`
// ErrMessage, if non-nil, contains a critical error message.
// For State InUseOtherUser, ErrMessage is not critical and just contains the details.
@ -116,7 +118,7 @@ type Notify struct {
// user's preferred storage location.
//
// Deprecated: use LocalClient.AwaitWaitingFiles instead.
FilesWaiting*empty.Message`json:",omitempty"`
FilesWaiting*empty.Message`json:",omitzero"`
// IncomingFiles, if non-nil, specifies which files are in the
// process of being received. A nil IncomingFiles means this
@ -125,22 +127,22 @@ type Notify struct {
// of being transferred.
//
// Deprecated: use LocalClient.AwaitWaitingFiles instead.
IncomingFiles[]PartialFile`json:",omitempty"`
IncomingFiles[]PartialFile`json:",omitzero"`
// OutgoingFiles, if non-nil, tracks which files are in the process of
// being sent via TailDrop, including files that finished, whether
// successful or failed. This slice is sorted by Started time, then Name.
OutgoingFiles[]*OutgoingFile`json:",omitempty"`
OutgoingFiles[]*OutgoingFile`json:",omitzero"`
// LocalTCPPort, if non-nil, informs the UI frontend which
// (non-zero) localhost TCP port it's listening on.
// This is currently only used by Tailscale when run in the
// macOS Network Extension.
LocalTCPPort*uint16`json:",omitempty"`
LocalTCPPort*uint16`json:",omitzero"`
// ClientVersion, if non-nil, describes whether a client version update