fix(migrate): route legacy v0.x sessions into their workspace session dirs#3944
Merged
Conversation
… dirs The flat import (#3247) reconstructed v0.x sessions into the global config session dir, but the desktop sidebar only lists the per-workspace projects/<slug>/sessions dirs — so for desktop users the import "succeeded" into a directory nothing reads, and upgraders kept reporting their history gone (#3937). - the per-workspace session-dir layout moves to config.ProjectSessionDir (the desktop helper now delegates), so the importer can route to it - the importer reads each session's v0.x sidecar (<name>.meta.json): a live workspace routes the session into that workspace's dir, the summary becomes its display title; dead/missing workspaces fall back to the global dir as before - a new one-time routed pass deliberately ignores the flat-import markers so existing upgraders get their stranded sessions re-homed; a global-dir file is only moved when its mtime matches the legacy event log (the flat import stamped it), so a same-named native v1+ session is never touched Trade-off: sessions a user deleted after the flat import reappear once (in their workspace) during the routed pass; there is no record that distinguishes "deleted by user" from "never imported", and recovering every stranded upgrade is worth one resurrection. Closes #3937
This was referenced Jun 12, 2026
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.
Fixes the headline complaint from every 0.53→1.x upgrade thread: sessions import "successfully" and then nobody can see them.
Root cause (from #3937)
The flat import (#3247) reconstructs v0.x sessions into the global config session dir, but the desktop sidebar only lists the per-workspace
projects/<slug>/sessionsdirs, and nothing reads the v0.x sidecar (<name>.meta.json) that says which workspace a session belonged to.What this does
config.ProjectSessionDir/config.WorkspaceSlug; the desktop helper delegates to it. Two consumers (sidebar + importer) → the concept lives in the root module..titles.json(the map the sidebar reads) so imported sessions are labeled. Dead or missing workspaces fall back to the global dir as before.Trade-off, stated plainly
A session the user deliberately deleted after the flat import reappears once (in its workspace) during the routed pass — there is no record distinguishing "deleted by user" from "never imported". Recovering every stranded upgrade beats protecting against one resurrection.
Tests
Closes #3937