fix(sessiond): remove legacy session archive migration - #107
Merged
Conversation
The migration moved ~/.pi-web/archived-sessions* into a custom PI_WEB_DATA_DIR at session daemon startup. Remove it outright: data directories are independent, and anyone who sets a custom data directory can copy archived-sessions.json and archived-sessions/ manually while the daemon is stopped. Without the migration, runSessionDaemonStartup's only remaining contract was sequencing create/register/listen, so inline those steps into sessiond.ts and drop the wrapper module and its tests.
Changing PI_WEB_DATA_DIR selects where managed state lives but never moves or copies existing state. Explain how to carry session archives over manually, and fix the stale "moves managed state location" claim in the config.html env table.
Documentation should describe what the software does, not enumerate what it does not do. Rephrase the data-directory wording around the positive facts (each directory is independent; a new root starts with empty state) and drop the "never moves or copies" constructions from config.md, the config.html env table, and the changeset.
Record that docs state what the software does and reserve "does not" statements for behavior that contradicts the most obvious expectation.
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.
What
Removes the legacy session archive migration from session daemon startup. The migration (introduced mid-July 2026) copied
archived-sessions.jsonandarchived-sessions/from the default~/.pi-weblocation into a newly configured customPI_WEB_DATA_DIRat startup, then deleted the legacy copy.Why
Data directories are independent: setting
PI_WEB_DATA_DIRselects where PI WEB-managed state lives, and existing state stays in the previous directory. The migration was destructive for temporary/secondary instances (it deleted the legacy state after copying), and the window in which anyone could still need it is narrow and past.Who could be affected
Only someone who has session archives created before July 2026 in the default
~/.pi-webdata directory and newly sets a customPI_WEB_DATA_DIR. Those archives simply stay in the old directory. To carry them over, stop PI WEB, then copyarchived-sessions.jsonand thearchived-sessions/directory from the old data directory into the new one.Changes
fix(sessiond): deletesessionArchiveMigration.ts(+ tests) and thesessionDaemonStartup.tswrapper (+ tests);sessiond.tsnow inlines the create → register → listen startup sequence with no migration step, result reporting, or failed-migration startup stop.docs(config):docs/config.md"Managed data directory" now states that each data directory is independent (a new root starts with empty registries and no session archives) and how to copy archives over manually; fixed the stale "moves managed state location" claim in theconfig.htmlenv table..changeset/remove-legacy-archive-migration.md(patchfor@jmfederico/pi-web) with the affected population and manual copy fallback.Verification
npm run verifygreen (typecheck, lint, knip, 251 test files / 2096 tests).rg -i "sessionArchiveMigration|migrateLegacySessionArchive|legacy session archive"clean).Deployment note
This touches the session daemon startup path: after upgrading, the running session daemon needs a restart to pick it up.