From d3f2ef9adb575e34bac5ba4066d258a8e51ac012 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 26 Jun 2026 17:38:56 +0200 Subject: [PATCH] Comment why not serial --- client/internal/mapsync.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/internal/mapsync.go b/client/internal/mapsync.go index 87d2b3553..db06d3495 100644 --- a/client/internal/mapsync.go +++ b/client/internal/mapsync.go @@ -52,6 +52,11 @@ func newMapStateManager(apply func(*mgmProto.SyncResponse) (bool, error), onConv func (m *mapStateManager) SetTarget(update *mgmProto.SyncResponse) error { m.mu.Lock() m.target = update + // Bump an internal generation counter, NOT the map serial: config-only updates + // (relay token rotation, STUN/TURN) arrive with NetworkMap == nil and carry no + // serial, yet must still be applied. Every SetTarget is therefore a distinct + // target regardless of payload. Map-serial staleness is enforced separately + // inside apply (updateNetworkMap). m.targetGen++ m.targetSetAt = time.Now() m.mu.Unlock()