mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-30 03:12:36 -04:00
Run() released the latch before setState() swapped in the fresh connect client, so Status() calls landing in that window still read the previous run's context state — which holds the NeedsLogin that prompted the login — and re-latched what had just been cleared. The generation guard does not catch this: the clear precedes the observation, so the generation matches and the store counts as current. The state-change goroutine calls Status() on every recorder tick, and the login path emits several, so the window is ordinary traffic rather than a rare interleaving. Clear once the replacement client is installed instead.