fix: force packaged Electron userData onto Dripnex (#572) - #573
Conversation
Packaged Linux followed package.json name @dripnex/desktop. Set the Electron app name and userData from resolveUserDataRoot before createDataPaths so CLI and the app share ~/.config/Dripnex. Co-authored-by: Tomás Maritano <tomymaritano@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change standardizes the Electron product name as ChangesUser-data initialization
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR aligns packaged app and CLI data locations while preserving explicit test and environment overrides; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DesktopMain
participant applyProductUserData
participant resolveElectronUserData
participant ElectronApp
DesktopMain->>applyProductUserData: initialize before Sentry
applyProductUserData->>ElectronApp: read current userData and process arguments
applyProductUserData->>resolveElectronUserData: resolve Dripnex configuration
resolveElectronUserData-->>applyProductUserData: name, userData, setUserDataPath
applyProductUserData->>ElectronApp: set application name
applyProductUserData->>ElectronApp: conditionally set userData path
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🎉 This PR is included in version 0.17.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Packaged Linux 0.16.1 still wrote plugins/DB/logs under
~/.config/@dripnex/desktopbecause Electronapp.getPath('userData')follows package.jsonname@dripnex/desktop. #567 only aligned CLIresolveUserDataRoot. This PR sets the Electron app name and userData to productNameDripnexbeforecreateDataPaths, so the packaged app anddripnex-pluginshare one folder.Type of Change
Related Issues
Closes #572
What changed
applyProductUserData()runs before Sentry andrequestSingleInstanceLock. It callsapp.setName('Dripnex')andapp.setPath('userData', resolveUserDataRoot())unless Chromium already has--user-data-dir(e2e).productName: "Dripnex"plus electron-builderextraMetadata.productNameso packagedpackage.jsondoes not rely on the scoped npm name forapp.getName().@dripnex/desktopwithdripnex.dborplugins/stays put viapickUserDataRoot. Fresh installs use~/.config/Dripnex/%APPDATA%/Dripnex/~/Library/Application Support/Dripnex.docs/plugins/install-path.mdrecords the packaged-app contract.No marketplace. No iOS. No release cut.
Checklist
@dripnex/storage-core29,@dripnex/plugin-cli19) and desktop/storage-core typecheckpnpm test/pnpm build(not required for this path-only change)developbranch (notmain)Test plan
resolveElectronUserDatanames the appDripnex, defaults to the packaged folder on Linux/Windows/macOS, keeps an existing scoped folder that already hasdripnex.db, honorsDRIPNEX_DATA_DIR, leaves--user-data-diralonedataDiris~/.config/Dripnexon a fresh machinedripnex-pluginand the packaged app resolve the same plugins dir--user-data-dir/DRIPNEX_DATA_DIRstill isolate testsSummary by CodeRabbit
New Features
Documentation
Tests