Conversation
Process-exit teardown was ending every live chat with tui_shutdown, and a WS 1012 service restart still armed the orphan reap. Neither path is a user delete, so populated Desktop rows must stay resumable after a profile-switch backend bounce. Log hard-deletes with a reason so a silent row loss is greppable.
HexLab98
force-pushed
the
fix/95868-desktop-reload-session-delete
branch
from
August 27, 2026 01:06
06ae88e to
159fa09
Compare
5 of 7 tasks
12 of 19 tasks
Collaborator
|
Closing as superseded on
Your alternative (never stamping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tui_shutdown, and the disconnect path still armed the WS-orphan reap against detached sessions (reaped_sessions=0,detached_sessions=N).tui_shutdownis treated as a recoverable accidental end for rows already stamped by older builds.delete_session/delete_session_if_emptylogid,reason, and whether the row had messages, so a silent hard-delete is greppable.Fixes #95868
Test plan
scripts/run_tests.sh tests/tui_gateway/test_finalize_session_persist.py tests/test_empty_session_hygiene.py tests/tui_gateway/test_startup_orphan_sweep.py tests/test_tui_gateway_ws.pyscripts/run_tests.sh tests/test_tui_gateway_server.py tests/tui_gateway/test_session_reclaim_notify.py -k "close_sessions_for_transport or test_session_delete or reclaim"ws closed ... code=1012 ... detached_sessions>0), switch back, confirm the original chats still appear and resume with history intactsqlite3 state.db "SELECT id, ended_at, end_reason FROM sessions;"after the reload — pre-reload ids still present,ended_atnull for the bounced chatsdelete_session id=... reason=session.delete(orapi.sessions.delete)