Skip to content

fix(desktop): close CloseTab-Snapshot/DeleteSession race window#4400

Closed
myipanta wants to merge 1 commit into
esengine:main-v2from
myipanta:hotfix/fix-4384-close-tab-race
Closed

fix(desktop): close CloseTab-Snapshot/DeleteSession race window#4400
myipanta wants to merge 1 commit into
esengine:main-v2from
myipanta:hotfix/fix-4384-close-tab-race

Conversation

@myipanta

Copy link
Copy Markdown
Contributor

Move Snapshot() inside the lock before delete(a.tabs, tabID) to prevent a race where DeleteSession removes session files after the tab is unregistered but before the deferred Snapshot writes them back.

Fixes #4384.

Move Snapshot() inside the lock before delete(a.tabs, tabID) to prevent
a race where DeleteSession removes session files after the tab is
unregistered but before the deferred Snapshot writes them back.

Fixes esengine#4384.
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 14, 2026
@SivanCola

Copy link
Copy Markdown
Collaborator

Integrated into #4942, which combines the related desktop sidebar/session runtime fixes on top of the latest main-v2.

I kept the relevant contribution from this PR credited in the #4942 body and commit co-author trailers. Please use #4942 as the integration path for this set of changes.

@SivanCola

Copy link
Copy Markdown
Collaborator

Closing this in favor of the merged integration PR #4942.

The CloseTab/DeleteSession resurrection fix from this PR was kept/adapted in #4942: writable tabs are snapshotted before unregistering, with follow-up handling so read-only channel transcripts remain browse-only on close.

@myipanta is credited in #4942's contribution table and commit co-author trailers. Thank you for the race-window fix.

@SivanCola SivanCola closed this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Session resurrects after deletion — race condition in CloseTab

3 participants