Skip to content

fix: let a station without a sign key be added again - #45

Merged
maxidragon merged 1 commit into
masterfrom
fix/re-add-after-reset
Nov 7, 2026
Merged

maxidragon merged 1 commit into
masterfrom
fix/re-add-after-reset

Conversation

@maxidragon

@maxidragon maxidragon commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Problem

"Reset settings" deletes the station's sign key, but the server keeps the old one. After the reset, every connect failed the trust check and showed "Server Not Trusted!". The server still listed the station as added, so the station never offered a new key, and it stayed stuck until someone deleted it on the panel's Devices page. Reproduced on a desk station.

Change

  • A station without a sign key doesn't count as added, whatever the server says (DeviceSettings.added && sign_key != 0). It shows the existing "Device not added" screen, and submit registers a fresh key through the usual Add flow, which a person approves in the panel.
  • The key mismatch right after a reset no longer shows "Server Not Trusted!". With sign key 0 a mismatch is expected, so it's logged as [trust] no sign key yet, waiting for the station to be added again instead. With a key set, a mismatch still shows the error.

Only a station with no key at all is affected. A station that has a key keeps today's behaviour, so a server that fails the trust check doesn't get a new key from a station that still holds one.

Needs FKMTime/micro-connector#25: the connector used to drop Add from a device it already knows.

Verification

  • cargo fmt --check; clippy -D warnings for v3, v4 and v3 + auto_add; release builds for v3 and v4.
  • Desk test on a v3 station (with connector Tls IoError after connection to server lost #25): the station had no key while the backend still held the old one. On boot it logged [trust] no sign key yet, waiting for the station to be added again, with no "Server Not Trusted!". Submit sent a new key, accepting it on the Devices page stored it, and after the next reconnect the handshake logged [trust] server trusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant