Live mode: load sheets off the UI thread, go offline cleanly on a lost device

Opening a sheet ran its Sox requests on the UI thread, so a device that had
gone away (a closed simulator) froze the window until DASP's 30 s receive
timeout. The load now runs on a background thread and the sheet is painted
when it finishes; a load the user has clicked away from is dropped.

When the session closes, the editor goes offline with "Connection lost:
<cause>" instead of printing a traceback. A send waiting for room in the
send window now fails when the session closes rather than going out after
the CLOSE. The tree-expand error callback no longer reads the exception
after its except block has ended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 21:24:27 +03:00
co-authored by Claude Opus 5.5
parent 6dd01b13b9
commit 95be6613f3
5 changed files with 131 additions and 43 deletions
+5
View File
@@ -421,6 +421,11 @@ class SoxClient:
def is_closed(self):
return self._session is None or self._session.is_closed
@property
def close_cause(self):
"""Why the session ended, e.g. "receive timeout"."""
return self._session.close_cause if self._session else "closed"
# ── Read Schema ─────────────────────────────────────────────
def read_schema(self):