From b5a7213cdb0b3c4a9d22013851cf6f32db30b1b8 Mon Sep 17 00:00:00 2001 From: Seraph91P <8904984+Serph91P@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:43:45 +0000 Subject: [PATCH] fix: preserve pending registration chain Backwards-compatible registrations do not receive a wg/connect response. Do not let them replace the chain ID of a normal registration that may already be in flight. --- newt/handlers.go | 4 +++- newt/ping.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/newt/handlers.go b/newt/handlers.go index 55c7f4e..3f57a11 100644 --- a/newt/handlers.go +++ b/newt/handlers.go @@ -1010,7 +1010,9 @@ func (n *Newt) registerHandlers(ctx context.Context) { } bcChainId := generateChainId() - n.pendingRegisterChainId = bcChainId + // Pangolin intentionally does not answer backwards-compatible + // registrations with newt/wg/connect. Do not replace the chain ID of + // the real registration while its response may already be in flight. if err := n.client.SendMessage(topicWGRegister, map[string]interface{}{ "publicKey": n.publicKey.String(), "newtVersion": n.config.Version, diff --git a/newt/ping.go b/newt/ping.go index 8ea7954..4126231 100644 --- a/newt/ping.go +++ b/newt/ping.go @@ -280,7 +280,8 @@ func (n *Newt) startPingCheck(fn pingFunc, serverIP, tunnelID string) chan struc "chainId": pingChainId, }, 3*time.Second) bcChainId := generateChainId() - n.pendingRegisterChainId = bcChainId + // This compatibility message has no wg/connect response and must + // not supersede the pending real registration chain. if err := n.client.SendMessage("newt/wg/register", map[string]interface{}{ "publicKey": n.publicKey.String(), "backwardsCompatible": true,