-
Notifications
You must be signed in to change notification settings - Fork 969
feat(setup): clone v2 host-service DBs alongside v1 local DB #3630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
890c7d3
feat(setup): clone v2 host-service DBs alongside v1 local DB
Kitenite 9f0442e
feat(setup): seed Electron renderer Local Storage from prod userData
Kitenite 23f38e6
feat(desktop): auto-pin accessible v2 workspaces in dev sidebar
Kitenite 06614a7
chore(deslop): tighten useDevSeedV2Sidebar JSDoc and drop restate-the…
Kitenite 8ba5548
chore(deslop): drop restate-the-code comment in step_seed_host_dbs
Kitenite c30e8ef
Lint
Kitenite 91d5f10
fix(setup): clean up partial host DB copies on failure
Kitenite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
1 change: 1 addition & 0 deletions
1
apps/desktop/src/renderer/routes/_authenticated/hooks/useDevSeedV2Sidebar/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { useDevSeedV2Sidebar } from "./useDevSeedV2Sidebar"; |
36 changes: 36 additions & 0 deletions
36
...sktop/src/renderer/routes/_authenticated/hooks/useDevSeedV2Sidebar/useDevSeedV2Sidebar.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { useEffect } from "react"; | ||
| import { env } from "renderer/env.renderer"; | ||
| import { useAccessibleV2Workspaces } from "renderer/routes/_authenticated/_dashboard/v2-workspaces/hooks/useAccessibleV2Workspaces"; | ||
| import { useDashboardSidebarState } from "renderer/routes/_authenticated/hooks/useDashboardSidebarState"; | ||
| import { useCollections } from "renderer/routes/_authenticated/providers/CollectionsProvider"; | ||
|
|
||
| const SEED_FLAG_KEY = "superset:dev:v2-sidebar-seeded"; | ||
|
|
||
| /** | ||
| * Auto-pins accessible v2 workspaces in dev so a fresh worktree's sidebar | ||
| * isn't blank. Chromium's localStorage is per-origin: the dev Vite origin | ||
| * (`http://localhost:<port>`) can't share data with the packaged `file://` | ||
| * origin, so copying prod's leveldb seeds the wrong namespace. We pin at | ||
| * runtime instead. The flag prevents re-pinning workspaces the user later | ||
| * unpins. | ||
| */ | ||
| export function useDevSeedV2Sidebar(): void { | ||
| const collections = useCollections(); | ||
| const { ensureWorkspaceInSidebar } = useDashboardSidebarState(); | ||
| const { all: accessibleWorkspaces } = useAccessibleV2Workspaces(); | ||
|
|
||
| useEffect(() => { | ||
| if (env.NODE_ENV !== "development") return; | ||
| if (window.localStorage.getItem(SEED_FLAG_KEY) === "1") return; | ||
| if (accessibleWorkspaces.length === 0) return; | ||
| if (collections.v2WorkspaceLocalState.state.size > 0) { | ||
| window.localStorage.setItem(SEED_FLAG_KEY, "1"); | ||
| return; | ||
| } | ||
|
|
||
| for (const workspace of accessibleWorkspaces) { | ||
| ensureWorkspaceInSidebar(workspace.id, workspace.projectId); | ||
| } | ||
| window.localStorage.setItem(SEED_FLAG_KEY, "1"); | ||
| }, [accessibleWorkspaces, collections, ensureWorkspaceInSidebar]); | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1:
step_seed_renderer_stateis missing fromsetup_main, so renderer Local Storage seeding no longer runs before auth token seeding.Prompt for AI agents