From e81339183e96af4ef69f219d264bfb133bc9d067 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 18 Mar 2024 14:54:06 +0200 Subject: [PATCH] Log warning if multiple devices are found for gaia pairing --- libgm/pair_google.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libgm/pair_google.go b/libgm/pair_google.go index ff032cf..47b9645 100644 --- a/libgm/pair_google.go +++ b/libgm/pair_google.go @@ -256,12 +256,23 @@ func (c *Client) DoGaiaPairing(ctx context.Context, emojiCallback func(string)) if err != nil { return fmt.Errorf("failed to prepare gaia pairing: %w", err) } + // Don't log the whole object as it also contains the tachyon token + zerolog.Ctx(ctx).Debug(). + Any("header", sigResp.Header). + Str("maybe_browser_uuid", sigResp.MaybeBrowserUUID). + Any("device_data", sigResp.DeviceData). + Msg("Gaia devices response") // TODO multiple devices? var destRegID string for _, dev := range sigResp.GetDeviceData().GetUnknownItems2() { if dev.GetUnknownInt4() == 1 { + if destRegID != "" { + zerolog.Ctx(ctx).Warn(). + Str("prev_reg_id", destRegID). + Str("next_reg_id", dev.GetDestOrSourceUUID()). + Msg("Found multiple primary-looking devices for gaia pairing") + } destRegID = dev.GetDestOrSourceUUID() - break } } if destRegID == "" {