fix(BRIDGE-395): skip saving the last used keychain helper as user preference on Windows & macOS

This commit is contained in:
Atanas Janeshliev
2025-06-27 13:23:06 +02:00
parent bffad05933
commit 2669bb4df9

View File

@ -22,6 +22,7 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"path" "path"
"runtime"
"github.com/ProtonMail/gluon/async" "github.com/ProtonMail/gluon/async"
"github.com/ProtonMail/proton-bridge/v3/internal/certs" "github.com/ProtonMail/proton-bridge/v3/internal/certs"
@ -106,9 +107,11 @@ func newVault(reporter *sentry.Reporter, locations *locations.Locations, keychai
return nil, false, corrupt, fmt.Errorf("could not create vault: %w", err) return nil, false, corrupt, fmt.Errorf("could not create vault: %w", err)
} }
// Remember the last successfully used keychain and store that as the user preference. // Remember the last successfully used keychain on Linux and store that as the user preference.
if err := vault.SetHelper(vaultDir, lastUsedHelper); err != nil { if runtime.GOOS == "linux" {
logrus.WithError(err).Error("Could not store last used keychain helper") if err := vault.SetHelper(vaultDir, lastUsedHelper); err != nil {
logrus.WithError(err).Error("Could not store last used keychain helper")
}
} }
return userVault, insecure, corrupt, nil return userVault, insecure, corrupt, nil