You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bridge): Save in Setări actually persists; local config always wins
Two root-causes of today's "am salvat, dar tot nu se aplică" loop:
1. Local config was not authoritative. The merge in ws_client.py let
server-pushed values overwrite some keys. Swapped the logic: now
every key the GUI can touch (serial_port, serial_baud, baud,
operator, operator_password, protocol, encoding_offset, bcc_algo,
bcc_coverage, cmd_width) is NEVER taken from the server — server
push only fills keys the local config doesn't provide (effectively
just cmd_codes).
2. Save button appeared to work but the new values never hit the file.
config.json had been created by LocalSystem during --install, so
the ProgramData inheritance gave regular user accounts only Read.
The write failed silently. Now:
- Atomic write via .tmp + os.replace
- After write, reload and compare every user-edited field; any
mismatch surfaces a RED message with actionable fix ("run bridge
as administrator, or icacls /grant Users:(M)")
- config.py's save() + the GUI save both grant BUILTIN\Users
Modify on the file immediately after writing, so the NEXT save
from a regular user account always succeeds without admin
Companion: Setări dialog geometry bumped to 480×540 (Save button was
off-screen after v0.3.17 added the Protocol dialect dropdown).
Unit tests still pass (13/13).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>