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
+3 -1
View File
@@ -598,7 +598,9 @@ class SendWindow:
while self._is_alive and (self._full() or self._exceeds_ack_more_limit(p)):
self._cond.wait()
if not self._is_alive:
return
# Waiting for room when the session closed: it must not go out after
# the CLOSE, and the caller must not take it as sent.
raise DaspException(f"Session closed: {self._session.close_cause}")
if self._tail is None:
self._head = self._tail = p
else: