feat(app): migrate localStorage openbook.workspaces → openbook.libraries (LIB-3)#136
Merged
Conversation
…ries (LIB-3) Rename the persisted library-list localStorage key value to openbook.libraries, with a one-time read-fallback migration: when the new key is absent, adopt any list under the legacy openbook.workspaces key, re-persist under the new key, and remove the old. A present new key always wins. The key is local-only — account sync serializes the in-memory library list (via useLibrary()) under the separate SyncBlob 'workspaces' wire property, which is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
LIB-3 of the workspace→library rename epic.
Migrates the persisted library-list localStorage key
openbook.workspaces→openbook.librarieswith a one-time read-fallback so existing users keep their list.Migration (
LibraryProvider.tsx): on read, ifopenbook.librariesis absent, adopt any value under the legacyopenbook.workspaces(LEGACY_LIBRARIES_KEY), re-persist under the new key, and remove the old. A present new key always wins (no clobber). Malformed value → default local library (unchanged behavior).Not the wire format: account sync builds
SyncBlob.workspaces(the wire property, preserved in LIB-2) from the in-memorylibrariesviauseLibrary()— it does NOT read this localStorage key. So this is a safe local migration, not a wire change. (Removed a stale comment that mislabeled the local key as the wire format.)Tests: new
LibraryProvider.test.tsxcovers 4 cases:AccountProvider.test.tsx(seeds the legacy key) still passes via the migration path.Verify — full
pnpm run verifyrun locally, all green:build:libs— PASStypecheck(all 6 workspace projects) — PASSlint(all 6 workspace projects) — PASStest(unit) — PASS: ui 981, sdk 175, server 645 (ui total includes the 4 new migration tests)test:e2e— PASS: server 251 checks, mcp 40 checksAlso:
GeneralSettings.tsx— one comment updated (openbook.workspaces→openbook.libraries).Scope guard: only the localStorage key + migration. No LIB-4 (
openbook.space.json/SPACE_BUNDLE_FILE), no LIB-5 (workspaceId//api/workspace/sync/ roster) tokens touched.In-repo — Manager merges after code review.