mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-11-29 08:49:10 +03:00
## Summary - Detect Linux desktop/session environments before Electron app readiness and set a secure `--password-store` backend when Electron would otherwise miss it. - Prefer `gnome-libsecret` for GNOME-compatible desktops and common tiling/window-manager sessions that often run libsecret/gnome-keyring. - Prefer the appropriate KWallet backend for KDE/Plasma sessions, including KDE 5/6 detection, while respecting any user-provided `--password-store` flag. - Add unit coverage for Linux/non-Linux behavior, existing user flags, GNOME/libsecret desktops, tiling WMs, KDE/Plasma KWallet variants, colon-separated desktop values, and fallback session variables. ## Test plan - [x] `yarn vitest packages/frontend/apps/electron/test/main/secure-storage.spec.ts` - [x] Electron main-process related tests were run; relevant tests passed, with unrelated existing failures noted in `recording-feature.spec.ts`. - [x] Prettier, oxlint, eslint, and TypeScript checks passed for the modified Electron files. Closes: #15301 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved secure password-store selection on Linux. * Added support for KDE/Plasma and GNOME-compatible desktop environments. * Preserves manually configured password-store settings and selects an appropriate fallback when needed. * **Tests** * Added coverage for Linux desktop detection, fallback behavior, session variations, and non-Linux environments. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: donqu1xotevincent <vincent@toeverything.info>