Skip to content

fix(sessiond): remove legacy session archive migration - #107

Merged
jmfederico merged 6 commits into
mainfrom
remove-legacy-archive-migration
Jul 28, 2026
Merged

fix(sessiond): remove legacy session archive migration#107
jmfederico merged 6 commits into
mainfrom
remove-legacy-archive-migration

Conversation

@jmfederico

@jmfederico jmfederico commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What

Removes the legacy session archive migration from session daemon startup. The migration (introduced mid-July 2026) copied archived-sessions.json and archived-sessions/ from the default ~/.pi-web location into a newly configured custom PI_WEB_DATA_DIR at startup, then deleted the legacy copy.

Why

Data directories are independent: setting PI_WEB_DATA_DIR selects 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-web data directory and newly sets a custom PI_WEB_DATA_DIR. Those archives simply stay in the old directory. To carry them over, stop PI WEB, then copy archived-sessions.json and the archived-sessions/ directory from the old data directory into the new one.

Changes

  • fix(sessiond): delete sessionArchiveMigration.ts (+ tests) and the sessionDaemonStartup.ts wrapper (+ tests); sessiond.ts now 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 the config.html env table.
  • Changeset: .changeset/remove-legacy-archive-migration.md (patch for @jmfederico/pi-web) with the affected population and manual copy fallback.

Verification

  • npm run verify green (typecheck, lint, knip, 251 test files / 2096 tests).
  • No references to the migration remain outside the changeset prose (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.

jmfederico and others added 6 commits July 28, 2026 16:13
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.
@jmfederico
jmfederico merged commit f9d0b2b into main Jul 28, 2026
2 checks passed
@jmfederico
jmfederico deleted the remove-legacy-archive-migration branch July 28, 2026 21:11
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.

1 participant