🔧 feat(desktop): add legacy local database detection and migration guidance#11682
🔧 feat(desktop): add legacy local database detection and migration guidance#11682
Conversation
…idance - Add hasLegacyLocalDb method to SystemController for detecting legacy DB - Update LoginStep to show migration link for users with legacy DB - Add i18n translations for legacy database migration feature - Improve common settings data sync configuration
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideAdds desktop legacy local database detection in the main Electron process and exposes it via IPC, then surfaces a migration guidance link in the desktop onboarding login step for affected users, while also adjusting common settings language selects layout, updating build/test script ordering, and bumping @lobehub/ui. Sequence diagram for legacy local DB detection and migration link openingsequenceDiagram
actor User
participant LoginStep
participant ElectronSystemService
participant IpcSystem
participant SystemController
participant FileSystem
participant ExternalBrowser
User->>LoginStep: Open desktop onboarding login step
LoginStep->>LoginStep: useEffect on mount
LoginStep->>LoginStep: Check isDesktop
alt Desktop runtime
LoginStep->>ElectronSystemService: hasLegacyLocalDb()
ElectronSystemService->>IpcSystem: system.hasLegacyLocalDb()
IpcSystem->>SystemController: hasLegacyLocalDb()
SystemController->>FileSystem: pathExists(legacyLocalDbDir)
alt Directory exists
SystemController->>FileSystem: readdir(legacyLocalDbDir)
alt Readable
FileSystem-->>SystemController: entries
SystemController-->>IpcSystem: entries.length > 0
else Error reading
SystemController-->>IpcSystem: true
end
else Directory missing
SystemController-->>IpcSystem: false
end
IpcSystem-->>ElectronSystemService: boolean hasLegacyLocalDb
ElectronSystemService-->>LoginStep: boolean hasLegacyLocalDb
LoginStep->>LoginStep: setHasLegacyLocalDb(true or false)
else Non desktop runtime
LoginStep->>LoginStep: Skip legacy DB check
end
User->>LoginStep: Click migration link (if visible)
LoginStep->>ElectronSystemService: openExternalLink(LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL)
ElectronSystemService->>IpcSystem: system.openExternalLink(url)
IpcSystem->>SystemController: openExternalLink(url)
SystemController->>ExternalBrowser: Open migration guide URL
Class diagram for ElectronSystemService and SystemController legacy DB supportclassDiagram
class ElectronSystemService {
+ipc SystemIpcProxy
+openExternalLink(url string) Promise~void~
+hasLegacyLocalDb() Promise~boolean~
+showContextMenu(type string, data any) Promise~void~
}
class SystemController {
+hasLegacyLocalDb() Promise~boolean~
+openExternalLink(url string) Promise~void~
-setSystemThemeMode(themeMode ThemeMode) Promise~void~
}
class SystemIpcProxy {
+system SystemControllerProxy
+menu MenuControllerProxy
+showContextMenu(data any, type string) Promise~void~
}
class LegacyDirectories {
+userDataDir string
+appStorageDir string
+legacyLocalDbDir string
}
ElectronSystemService --> SystemIpcProxy : uses
SystemIpcProxy --> SystemController : proxiesCallsTo
SystemController ..> LegacyDirectories : readsPathsFrom
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
TestGru AssignmentSummary
Tip You can |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The hard-coded
LEGACY_LOCAL_DB_MIGRATION_GUIDE_URLconstant inLoginStepis still a placeholder; consider sourcing this from configuration (env, build-time config, or a shared constant) so it can be updated without code changes and won’t accidentally ship with a placeholder. - The new Flexbox-wrapped language
Selectcomponents use inline styles with a fixedwidth: '50%'; it may be more robust to use a responsive layout or theme tokens/classes instead of a hardcoded percentage to better handle smaller viewports and design changes. - In the
useEffectthat callselectronSystemService.hasLegacyLocalDb, the.catch(() => undefined)silently ignores errors; consider at least logging or surfacing a non-blocking warning so issues detecting the legacy DB can be diagnosed if something goes wrong at runtime.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The hard-coded `LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL` constant in `LoginStep` is still a placeholder; consider sourcing this from configuration (env, build-time config, or a shared constant) so it can be updated without code changes and won’t accidentally ship with a placeholder.
- The new Flexbox-wrapped language `Select` components use inline styles with a fixed `width: '50%'`; it may be more robust to use a responsive layout or theme tokens/classes instead of a hardcoded percentage to better handle smaller viewports and design changes.
- In the `useEffect` that calls `electronSystemService.hasLegacyLocalDb`, the `.catch(() => undefined)` silently ignores errors; consider at least logging or surfacing a non-blocking warning so issues detecting the legacy DB can be diagnosed if something goes wrong at runtime.
## Individual Comments
### Comment 1
<location> `src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx:24` </location>
<code_context>
import LobeMessage from '../components/LobeMessage';
+const LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL = 'PLACEHOLDER_LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL';
+
// 登录方式类型
</code_context>
<issue_to_address>
**issue (bug_risk):** The migration guide URL is left as a placeholder, which will result in a broken link at runtime.
This constant is still `'PLACEHOLDER_LEGACY_LOCAL_DB_MIGRATION_GUIDE_URL'` but is passed directly to `openExternalLink`, so legacy local DB users will get a broken or useless link. Please replace this with a real URL (ideally sourced from config/env or a shared URL constant) so it’s correct and can be updated without a code change.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #11682 +/- ##
==========================================
+ Coverage 72.52% 74.05% +1.53%
==========================================
Files 1155 1187 +32
Lines 87510 94519 +7009
Branches 11538 12858 +1320
==========================================
+ Hits 63463 70000 +6537
- Misses 23957 24429 +472
Partials 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Add mock implementation of getAppPath in SystemCtr and macOS test files - Update LoginStep to use urlJoin for constructing migration guide URL Signed-off-by: Innei <tukon479@gmail.com>
|
❤️ Great PR @Innei ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 2.0.0-next.333](v2.0.0-next.332...v2.0.0-next.333) <sup>Released on **2026-01-21**</sup> #### ✨ Features - **desktop**: Add legacy local database detection and migration guidance. - **misc**: Update the sandbox preinstall libs in sys role. #### 🐛 Bug Fixes - **misc**: Fix multi tasks no summary issue. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **desktop**: Add legacy local database detection and migration guidance, closes [#11682](#11682) ([5664b84](5664b84)) * **misc**: Update the sandbox preinstall libs in sys role, closes [#11688](#11688) ([404c577](404c577)) #### What's fixed * **misc**: Fix multi tasks no summary issue, closes [#11685](#11685) ([26ce317](26ce317)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 2.0.0-next.333 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.153.0](v1.152.0...v1.153.0) <sup>Released on **2026-01-23**</sup> #### ♻ Code Refactoring - **auth**: Remove NEXT_PUBLIC_AUTH_URL env variable. - **model-select**: Migrate FunctionCallingModelSelect to LobeSelect. - **ModelSwitchPanel**: Migrate from Popover to DropdownMenu with virtual scrolling. - **userMemories**: Removed un-used code. - **misc**: Improve memory data with experience and identity, move vercel-react-best-practices skills to .agents directory. #### ✨ Features - **database**: Added user memory activity. - **desktop**: Add legacy local database detection and migration guidance. - **misc**: Add platform-aware download client menu option, add server version check for desktop app, remove Clerk authentication code, skill setting page and skill store, support agent group unpublish agents, support client tasks mode, update the sandbox preinstall libs in sys role. #### 🐛 Bug Fixes - **copilot**: Pass correct scope when creating new session in PageEditor. - **desktop**: Gracefully handle missing update manifest 404 errors. - **model-runtime**: Filter unsupported image types (SVG) before sending to vision models. - **pdf**: Upgrade pdfjs-dist and react-pdf to v5.x. - **sidebar-drawer**: Fix drawer positioning and title style. - **misc**: Fix group broadcast trigger tool use, fix local system tools, fix memory schema, fix multi agent tasks issue, fix multi tasks no summary issue, fix scope issue, fix tool argument scape and improve multi task run, fixed the sandbox tools call when error should use right callback, improve e2e server and complete i18n resources, slove the agent group editor not focus in editdata area, slove the agents header switch agents the lobeAI not show problem, sloved the old removeSessionTopics not work, TypewriterEffect not refreshing on language change, updata cron job ui & fixed commnuity pagenation goto error, update the agentbuilder tools not always use humanIntervention. #### 💄 Styles - **misc**: Improve auto scroll and group profile, update og, update share style. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **auth**: Remove NEXT_PUBLIC_AUTH_URL env variable, closes [lobehub#11658](https://github.com/jaworldwideorg/OneJA-Bot/issues/11658) ([c0f9875](c0f9875)) * **model-select**: Migrate FunctionCallingModelSelect to LobeSelect, closes [lobehub#11664](https://github.com/jaworldwideorg/OneJA-Bot/issues/11664) ([ad51305](ad51305)) * **ModelSwitchPanel**: Migrate from Popover to DropdownMenu with virtual scrolling, closes [lobehub#11663](https://github.com/jaworldwideorg/OneJA-Bot/issues/11663) ([c9d9dff](c9d9dff)) * **userMemories**: Removed un-used code, closes [lobehub#11713](https://github.com/jaworldwideorg/OneJA-Bot/issues/11713) ([89750fc](89750fc)) * **misc**: Improve memory data with experience and identity, closes [lobehub#11717](https://github.com/jaworldwideorg/OneJA-Bot/issues/11717) ([bdb3eb4](bdb3eb4)) * **misc**: Move vercel-react-best-practices skills to .agents directory, closes [lobehub#11703](https://github.com/jaworldwideorg/OneJA-Bot/issues/11703) ([6df7731](6df7731)) #### What's improved * **database**: Added user memory activity, closes [lobehub#11680](https://github.com/jaworldwideorg/OneJA-Bot/issues/11680) ([0160fbd](0160fbd)) * **desktop**: Add legacy local database detection and migration guidance, closes [lobehub#11682](https://github.com/jaworldwideorg/OneJA-Bot/issues/11682) ([5664b84](5664b84)) * **misc**: Add platform-aware download client menu option, closes [lobehub#11676](https://github.com/jaworldwideorg/OneJA-Bot/issues/11676) ([55abddc](55abddc)) * **misc**: Add server version check for desktop app, closes [lobehub#11710](https://github.com/jaworldwideorg/OneJA-Bot/issues/11710) ([0cf2723](0cf2723)) * **misc**: Remove Clerk authentication code, closes [lobehub#11711](https://github.com/jaworldwideorg/OneJA-Bot/issues/11711) ([395595a](395595a)) * **misc**: Skill setting page and skill store, closes [lobehub#11665](https://github.com/jaworldwideorg/OneJA-Bot/issues/11665) ([d8c0c26](d8c0c26)) * **misc**: Support agent group unpublish agents, closes [lobehub#11687](https://github.com/jaworldwideorg/OneJA-Bot/issues/11687) ([4e060be](4e060be)) * **misc**: Support client tasks mode, closes [lobehub#11666](https://github.com/jaworldwideorg/OneJA-Bot/issues/11666) ([98cf57b](98cf57b)) * **misc**: Update the sandbox preinstall libs in sys role, closes [lobehub#11688](https://github.com/jaworldwideorg/OneJA-Bot/issues/11688) ([404c577](404c577)) #### What's fixed * **copilot**: Pass correct scope when creating new session in PageEditor, closes [lobehub#11714](https://github.com/jaworldwideorg/OneJA-Bot/issues/11714) ([0259270](0259270)) * **desktop**: Gracefully handle missing update manifest 404 errors, closes [lobehub#11625](https://github.com/jaworldwideorg/OneJA-Bot/issues/11625) ([13e95b9](13e95b9)) * **model-runtime**: Filter unsupported image types (SVG) before sending to vision models, closes [lobehub#11698](https://github.com/jaworldwideorg/OneJA-Bot/issues/11698) ([c0c99a7](c0c99a7)) * **pdf**: Upgrade pdfjs-dist and react-pdf to v5.x, closes [lobehub#11686](https://github.com/jaworldwideorg/OneJA-Bot/issues/11686) ([2b620df](2b620df)) * **sidebar-drawer**: Fix drawer positioning and title style, closes [lobehub#11655](https://github.com/jaworldwideorg/OneJA-Bot/issues/11655) ([cf5320e](cf5320e)) * **misc**: Fix group broadcast trigger tool use, closes [lobehub#11646](https://github.com/jaworldwideorg/OneJA-Bot/issues/11646) ([831a9b3](831a9b3)) * **misc**: Fix local system tools, closes [lobehub#11702](https://github.com/jaworldwideorg/OneJA-Bot/issues/11702) ([6548fc7](6548fc7)) * **misc**: Fix memory schema, closes [lobehub#11645](https://github.com/jaworldwideorg/OneJA-Bot/issues/11645) ([3baf780](3baf780)) * **misc**: Fix multi agent tasks issue, closes [lobehub#11672](https://github.com/jaworldwideorg/OneJA-Bot/issues/11672) ([9de773b](9de773b)) * **misc**: Fix multi tasks no summary issue, closes [lobehub#11685](https://github.com/jaworldwideorg/OneJA-Bot/issues/11685) ([26ce317](26ce317)) * **misc**: Fix scope issue, closes [lobehub#11719](https://github.com/jaworldwideorg/OneJA-Bot/issues/11719) ([17adde8](17adde8)) * **misc**: Fix tool argument scape and improve multi task run, closes [lobehub#11691](https://github.com/jaworldwideorg/OneJA-Bot/issues/11691) ([b13bb8a](b13bb8a)) * **misc**: Fixed the sandbox tools call when error should use right callback, closes [lobehub#11721](https://github.com/jaworldwideorg/OneJA-Bot/issues/11721) ([e8fce68](e8fce68)) * **misc**: Improve e2e server and complete i18n resources, closes [lobehub#11678](https://github.com/jaworldwideorg/OneJA-Bot/issues/11678) ([d450dd9](d450dd9)) * **misc**: Slove the agent group editor not focus in editdata area, closes [lobehub#11677](https://github.com/jaworldwideorg/OneJA-Bot/issues/11677) ([9ac84e6](9ac84e6)) * **misc**: Slove the agents header switch agents the lobeAI not show problem, closes [lobehub#11726](https://github.com/jaworldwideorg/OneJA-Bot/issues/11726) ([f45f508](f45f508)) * **misc**: Sloved the old removeSessionTopics not work, closes [lobehub#11671](https://github.com/jaworldwideorg/OneJA-Bot/issues/11671) ([06d41e5](06d41e5)) * **misc**: TypewriterEffect not refreshing on language change, closes [lobehub#11657](https://github.com/jaworldwideorg/OneJA-Bot/issues/11657) ([ba30f46](ba30f46)) * **misc**: Updata cron job ui & fixed commnuity pagenation goto error, closes [lobehub#11700](https://github.com/jaworldwideorg/OneJA-Bot/issues/11700) ([42ad2a0](42ad2a0)) * **misc**: Update the agentbuilder tools not always use humanIntervention, closes [lobehub#11696](https://github.com/jaworldwideorg/OneJA-Bot/issues/11696) ([0d3017b](0d3017b)) #### Styles * **misc**: Improve auto scroll and group profile, closes [lobehub#11725](https://github.com/jaworldwideorg/OneJA-Bot/issues/11725) ([550acc2](550acc2)) * **misc**: Update og, closes [lobehub#11709](https://github.com/jaworldwideorg/OneJA-Bot/issues/11709) ([01cf4e4](01cf4e4)) * **misc**: Update share style, closes [lobehub#11716](https://github.com/jaworldwideorg/OneJA-Bot/issues/11716) ([3c70dfa](3c70dfa)) </details> <div align="right"> [](#readme-top) </div>
Summary by Sourcery
Detect legacy local desktop databases and surface migration guidance during desktop onboarding.
New Features:
Enhancements:
Build:
Documentation:
Chores: