From ab9ff8781522a7c3180cdff73eb6a572c7f0a079 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 4 Feb 2025 15:46:58 +0200 Subject: [PATCH] push: log data if it's not json --- pkg/connector/push.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/connector/push.go b/pkg/connector/push.go index b9ebc290..8f386a24 100644 --- a/pkg/connector/push.go +++ b/pkg/connector/push.go @@ -11,6 +11,7 @@ import ( "github.com/gotd/td/bin" "github.com/gotd/td/crypto" "github.com/gotd/td/tg" + "github.com/rs/zerolog" "github.com/tidwall/gjson" "go.mau.fi/util/exslices" "go.mau.fi/util/random" @@ -339,6 +340,7 @@ UserLoop: var pmd PushNotificationData err = json.Unmarshal(plaintext, &pmd) if err != nil { + zerolog.Ctx(ctx).Debug().Str("raw_data", base64.StdEncoding.EncodeToString(plaintext)).Msg("Decrypted non-JSON push data") return userLoginID, nil, fmt.Errorf("failed to unmarshal decrypted payload: %w", err) } return userLoginID, &pmd, nil