Skip to content

Properly close tabs and files of archived or deleted sessions - #70

Merged
hardbeat920 merged 3 commits into
hardbeat920:mainfrom
kinsomicrote:fix/archive-and-delete-session
Sep 5, 2026
Merged

Properly close tabs and files of archived or deleted sessions#70
hardbeat920 merged 3 commits into
hardbeat920:mainfrom
kinsomicrote:fix/archive-and-delete-session

Conversation

@kinsomicrote

Copy link
Copy Markdown
Contributor

What changed

  • Archiving a session removes the tab
  • Deleting a session removes open files

Why

Before now, archiving a session left the tab in place, which is inconsistent with expectations. Deleting a session promoted open files to a session tab.

UI

CleanShot 2026-09-04 at 20 41 58

Checklist

  • I ran npm run check
  • This PR is small and focused
  • I did not mix unrelated changes

@kinsomicrote

Copy link
Copy Markdown
Contributor Author

@hardbeat920 this PR fixes the bug I mentioned. Let me know if there are any changes I need to make.

@hardbeat920

Copy link
Copy Markdown
Owner

Thanks for the fix @kinsomicrote

the workspace behavior makes sense and the lifecycle helper is well tested.

Before merging, could we address two persistence races?

  1. Archiving captures and persists open before stopping/flushing a busy turn, so recently buffered output may be lost. The save failure is also swallowed before the tab is removed.

  2. Deletion runs before invalidating the turn and clearing pending writes, allowing a late upsertSession() to recreate the deleted database record.

Please stop/invalidate and flush first, persist the latest snapshot successfully when archiving, and serialize deletion after pending upserts. Integration tests covering archive/delete during an active turn would be valuable.

Thanks again 🙏

@kinsomicrote

Copy link
Copy Markdown
Contributor Author

@hardbeat920 I've updated the PR.

@hardbeat920
hardbeat920 merged commit cb6e2df into hardbeat920:main Sep 5, 2026
2 checks passed
@hardbeat920

Copy link
Copy Markdown
Owner

@kinsomicrote thank you! Merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants