From: Anderson A. Giacomolli Date: Wed, 11 Nov 2026 14:22:47 +0000 (-0300) Subject: Keep recovery advice out of log events X-Git-Url: https://git.giacomolli.uk/onechat/commitdiff_plain/0979625154094df73577d6e2be2d0e9a0a87306c?ds=inline;hp=d7f6fba630444f5065f59cd3729feab92c7798aa Keep recovery advice out of log events The WhatsApp logout log records the event without a command for the user. The existing user-facing notice still explains how to pair again, so recovery advice reaches the user without becoming part of the event name. Issue: 3cdc678 --- diff --git a/whatsapp.go b/whatsapp.go index 1e6bfa8..91ee675 100644 --- a/whatsapp.go +++ b/whatsapp.go @@ -456,7 +456,7 @@ func (w *WhatsApp) loggedOut(ctx context.Context, l *TurnLoop) error { return nil } - w.logger.Error("logged out by the phone, run /whatsapp pair PHONE") + w.logger.Error("logged out by the phone") err := w.inbox.deliver(ctx, l, w.link(), true) if err != nil { diff --git a/whatsapp_test.go b/whatsapp_test.go index 6475805..d200a91 100644 --- a/whatsapp_test.go +++ b/whatsapp_test.go @@ -601,7 +601,7 @@ func TestWhatsAppLogoutFromThePhone(t *testing.T) { notice := "WhatsApp was unlinked from the phone. Run /whatsapp pair PHONE to link it again." client.WaitFor(t, notice) telegramWaitForSent(t, telegram, notice) - require.Equal(t, "<3>logged out by the phone, run /whatsapp pair PHONE\n", logs.String()) + require.Equal(t, "<3>logged out by the phone\n", logs.String()) require.NoFileExists(t, filepath.Join(dir, whatsappDirName, whatsappSessionFileName)) require.Equal(t, "WhatsApp is not linked. Run /whatsapp pair PHONE to link it.", whatsapp.Status()) require.Equal(t, []string{"WhatsApp was unlinked from the phone."}, whatsappTestLogTexts(t, memory))