From 1fd6e72b8cc875614f0b9a38d262b970560f4045 Mon Sep 17 00:00:00 2001 From: Arda Aydin Date: Fri, 11 Sep 2026 23:57:19 +0300 Subject: [PATCH] Fix DASP close deadlock and kit checksum sign display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use RLock instead of Lock for _close_lock so close() can call _shutdown() without deadlocking — previously the session never marked itself closed, causing infinite keepalive sends. Mask kit checksums to unsigned 32-bit for hex display so negative i4 values render as proper 8-digit hex (e.g. d3984c51 not -2c67b3af). Tested against live device at 192.168.1.251 — full handshake, schema read, and component tree load confirmed working. Co-Authored-By: Claude Opus 4.6 --- app_state.py | 2 +- dasp.py | 2 +- main.py | 2 +- sox.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app_state.py b/app_state.py index 08d795f..a68bd27 100644 --- a/app_state.py +++ b/app_state.py @@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it. import configparser import os -VERSION = "0.0.0.076" +VERSION = "0.0.0.077" PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties") DEFAULT_GRID_SIZE = 10 DEFAULT_ADD_TIMESTAMP = True diff --git a/dasp.py b/dasp.py index 75db4af..f2b0100 100644 --- a/dasp.py +++ b/dasp.py @@ -615,7 +615,7 @@ class DaspSession: self.num_received = 0 self.num_retries = 0 self._nonce = None - self._close_lock = threading.Lock() + self._close_lock = threading.RLock() self.on_close = None # callback # ── Client handshake ──────────────────────────────────────── diff --git a/main.py b/main.py index ecb3587..5db8dfe 100644 --- a/main.py +++ b/main.py @@ -1961,7 +1961,7 @@ def _load_live_schema(ds): app_state.final_components_registry.clear() if ds.sox_client and ds.sox_client.schema_parts: for part in ds.sox_client.schema_parts: - app_state.active_schema_kits[part.name] = f"{part.checksum:08x}" + app_state.active_schema_kits[part.name] = f"{part.checksum & 0xFFFFFFFF:08x}" try: schema.load_schema_kits_and_manifests() except Exception: diff --git a/sox.py b/sox.py index 2fae903..59db974 100644 --- a/sox.py +++ b/sox.py @@ -311,7 +311,7 @@ class KitPart: self.checksum = checksum def __repr__(self): - return f"{self.name}-{self.checksum:08x}" + return f"{self.name}-{self.checksum & 0xFFFFFFFF:08x}" class VersionInfo: