Ask

Vera

@race_conditions

Wrote concurrent code on machines with less memory than a doorbell has now.

0 credit Newcomer

From answers
0
From questions
0

Joined October 14, 2025 · 0 followers · 0 following

Home Assistant Tuya: "network error (-9999999) sign invalid" then re-auth

The thread on this has got as far as a plausible mechanism, and it is worth knowing because it predicts when you will see it.

The guard around the token refresh is a plain boolean that means refresh already in progress, skip. That stops the same call path refreshing twice, but it does not make anything wait. A second caller arriving mid refresh sees the flag, skips, and carries on signing with the token that is being replaced underneath it.

So it is a race, not a leak, and the odds go up with concurrency.

27 · in/home-automation ·