Skip to content

fix(desktop): preserve conflicting trash sessions#6037

Merged
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/unique-trash-conflict
Jul 6, 2026
Merged

fix(desktop): preserve conflicting trash sessions#6037
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/unique-trash-conflict

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Move divergent live sessions into a unique trash item when the fixed .trash/<key>/<key> entry already exists.
  • Keep the old fast paths for empty/duplicate live sessions, and continue refusing deletes while another runtime owns the session lease.
  • Teach trash listing/path validation to resolve unique trash items through .trash-meta.json so restore and purge keep working.

Root Cause

Recovery/session trash entries used the session basename as both the logical key and the storage item directory. When an older recovery copy was already in trash and the live recovery later diverged, delete refused with session already exists in trash to avoid overwriting either history.

Validation

  • cd desktop && go test . -run 'TestDeleteSessionValidTrash(RenamesDifferentLiveConflict|RemovesEmptyLiveStub|RemovesDuplicateLiveSession)|TestDeleteSessionTrashConflictKeepsRuntime|TestDeleteSessionKeepsDuplicateLiveSessionHeldByOtherRuntime|TestRestoreSessionRejectsOpenEmptyLiveStub|TestRestoreTrashedSessionFileFromUniqueTrashItem' -v
  • cd desktop && go test . -run 'TestReconcileDesktopCleanupPendingDelete(MovesArtifactsToTrash|ReusesExistingTrashDir|MovesRemainingSidecars)|TestDeleteSessionFile|TestValidateSessionTrashTargetKeepsDiscardableLiveStub|TestTrashPathsBlockedWhileLeaseHeld|TestRestoreTrashedSessionFile|TestPurgeTrashedSessionFile|TestListTrashedSessionFilesRejectsSymlinkEscape|TestTrashTopic' -v
  • cd desktop && go test .

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jul 5, 2026
@SivanCola SivanCola force-pushed the fix/unique-trash-conflict branch from d89c1a0 to b9beebd Compare July 6, 2026 01:07
@SivanCola SivanCola marked this pull request as ready for review July 6, 2026 01:14
@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 01:14
@SivanCola SivanCola merged commit 9f43d13 into esengine:main-v2 Jul 6, 2026
15 checks passed
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.

1 participant