Skip to content

v1.3.0 — Code-review fixes + architecture

Choose a tag to compare

@temandroid temandroid released this 14 Jun 08:34

v1.3.0 — Full code-review pass + architecture

Third full review (Opus, max effort). Closes 7 correctness findings + 6 architecture improvements.

Correctness

  • TimeoutError no longer dead-ends setup — aiohttp's total-timeout raises asyncio.TimeoutError (not ClientError); it (and malformed-JSON ValueError) are now caught, so a slow miner at startup retries instead of going to SETUP_ERROR.
  • Concurrent re-login is serialised — an asyncio.Lock + epoch counter means two simultaneous 401s produce a single POST /unlock instead of duelling logins that can invalidate each other's token (false re-auth) on single-session firmware.
  • x-api-key kept on login — a miner configured with both API key and password keeps the API-key fallback after a JWT login.
  • Malformed /info can't poison stateisinstance guard rejects a None/list payload.
  • Switch & pool select no longer bounce — optimistic state is held until the miner's reported state catches up; the command is sent first so a failure surfaces and leaves state intact.

Architecture / improvements

  • MAC-based device identity (collision-safe) — adopts the MAC as a stable, DHCP-resilient identity + connection, but only when it is unique across configured miners. Vnish firmware is known to clone identifiers (the reason v1.1.1 moved off the serial), so a cloned MAC falls back to the guaranteed-unique host IP — no device merge. Idempotent in-place device-registry migration preserves history.
  • Pool select entity — exposes the previously unreachable switch_pool as a select.
  • Diagnostics — redacted config-entry diagnostics dump.
  • PARALLEL_UPDATES = 0 on every platform (coordinator idiom).
  • Re-auth dead-end fixedassert replaced with explicit async_abort.
  • manifestintegration_type: device, loggers, codeowner → @temandroid.

i18n / tests

  • select.pool + reauth_failed strings (EN + RU); test_select.py.