Skip to content

[Bug]: Safestorage detection fails on linux outside of predefined desktop environments #39789

Closed

Description

@OmegaRogue

Preflight Checklist

Electron Version

25.6

What operating system are you using?

Other Linux

Operating System Version

Arch Linux

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

If libsecret is present, safestorage uses libsecret
if kwallet is present, safestorage uses kwallet

Actual Behavior

unless the variable XDG_CURRENT_DESKTOP is set to a handful of predefined values, using safestorage fails.

microsoft/vscode#185212
theripper93/fvtt-player-client#7

Testcase Gist URL

No response

Additional Information

Instead of reading this variable for this, electron should look for the presence of libsecret or kwalletin order to properly detect this. This has been reported on the VSCode github repo a bunch, tho this affects electron as a whole, including a project I contribute to.

Activity

  1. VerteDinde commented on Sep 11, 2023

    @VerteDinde
    Member

    I think this was intentionally implemented here: https://github.com/electron/electron/pull/38873/files/ . This should be available in Electron beginning in 25.5.0 (ref: https://releases.electronjs.org/release/v25.5.0), so I think it should be present in 25.6.0.

    @OmegaRogue Can you try using the getSelectedStorageBackend() API added in that PR, and seeing if it correctly detects libsecret and/or kwallet for you? If it doesn't or if we seem to be missing a preset value to detect, that may be a bug. But using those predefined values is expected behavior right now.

  2. added
    blocked/need-info ❌
    on Sep 11, 2023
  3. moved this to 👀 Unsorted Items in 26-x-yon Sep 11, 2023
  4. moved this to Unsorted Items in 25-x-yon Sep 11, 2023
  5. OmegaRogue commented on Sep 11, 2023

    @OmegaRogue
    Author

    getSelectedStorageBackend() returns basic_text for me, as my XDG_CURRENT_DESKTOP is set to xinitrc, as i use a custom built desktop environment around the awesomewm window manager

  6. OmegaRogue commented on Sep 11, 2023

    @OmegaRogue
    Author

    Upgrading to electron 26.2.0 doesn't impact the result at all

  7. electron-issue-triage commented on Dec 11, 2023

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  8. OmegaRogue commented on Dec 13, 2023

    @OmegaRogue
    Author

    Bump

  9. 3 remaining items

  10. added
    status/confirmed
    and removed on Apr 10, 2024
  11. cjshearer commented on Jun 1, 2024

    @cjshearer

    On NixOS 23.11, the bug presents itself between v29.3.0 (working) and v29.4.0 (broken) and is still present in v30.0.6 (latest available on nix as of the moment).

    However, since updating to NixOS 24.05, the bug is no longer present in v30.0.6. Perhaps there was some other incompatibility present on 23.11.

  12. added a commit that references this issue on Jun 4, 2024
  13. t3chguy commented on Apr 16, 2025

    @t3chguy

    I am seeing the same behaviour in a Debian 11 VM with LXDE even though gnome-keyring is available & configured

  14. removed
    blocked/need-info ❌
    on Apr 16, 2025
  15. readefries commented on Aug 19, 2025

    @readefries

    Still broken on Debian 13 and Gnome 48 with properly configured keyring

  16. 103sbavert commented on Sep 17, 2025

    @103sbavert

    bump

  17. dasoe commented on Oct 22, 2025

    @dasoe

    bump

  18. keysmashes commented on Oct 22, 2025

    @keysmashes

    it's moderately annoying to bump this for no reason :)

    a hopefully-actually-useful addition: another workaround, which shouldn't negatively affect anything else (unlike setting $XDG_CURRENT_DESKTOP, potentially), is to set GNOME_DESKTOP_SESSION_ID=this-is-deprecated. this works because GetDesktopEnvironment includes the following:

      if (env->HasVar("GNOME_DESKTOP_SESSION_ID")) {
        return DESKTOP_ENVIRONMENT_GNOME;
      }
    

    which will cause SelectBackend to pick the libsecret backend.

  19. dasoe commented on Oct 22, 2025

    @dasoe

    Well, sorry. I understood, this was requested?

    If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open.

    The issue is affecting me. I can not give real Information about Electron. I am using Element (Matrix App) Version 1.12.1, Ubuntu 22.04, Flathub Version.
    I tried to read about the problem and was finally sent here, as obviously Element uses Electron. Version seems to be 33.0.0?

  20. t3chguy commented on Oct 27, 2025

    @t3chguy

    @dasoe last I checked this is due to the community maintained flatpak package, not Electron or Element. They do not allow org.freedesktop.secrets which I recommended they do on a couple of occasions. See flathub/im.riot.Riot#462 (comment) for an example of how to workaround it.

  21. razzeee commented on Oct 27, 2025

    @razzeee
    Contributor

    Technically that would allow electron / element to access all your secrets. Which is something that people are not keen to.

    flathub/im.riot.Riot#530 (comment)

  22. self-assigned this
    on Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

25-x-y26-x-ybug 🪲platform/linuxstatus/confirmed

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions