mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-04 00:08:33 +00:00
GODT-2251: Store gluon cache in user cache rather than user data
This commit is contained in:
@ -88,12 +88,19 @@ func (s *scenario) theUserChangesTheGluonPath() error {
|
||||
}
|
||||
|
||||
func (s *scenario) theUserDeletesTheGluonFiles() error {
|
||||
path, err := s.t.locator.ProvideGluonPath()
|
||||
if err != nil {
|
||||
return err
|
||||
if path, err := s.t.locator.ProvideGluonCachePath(); err != nil {
|
||||
return fmt.Errorf("failed to get gluon cache path: %w", err)
|
||||
} else if err := os.RemoveAll(path); err != nil {
|
||||
return fmt.Errorf("failed to remove gluon cache path: %w", err)
|
||||
}
|
||||
|
||||
return os.RemoveAll(path)
|
||||
if path, err := s.t.locator.ProvideGluonConfigPath(); err != nil {
|
||||
return fmt.Errorf("failed to get gluon config path: %w", err)
|
||||
} else if err := os.RemoveAll(path); err != nil {
|
||||
return fmt.Errorf("failed to remove gluon config path: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *scenario) theUserHasDisabledAutomaticUpdates() error {
|
||||
|
||||
@ -100,13 +100,13 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
|
||||
}
|
||||
|
||||
// Get the default gluon path.
|
||||
gluonDir, err := t.locator.ProvideGluonPath()
|
||||
gluonCacheDir, err := t.locator.ProvideGluonCachePath()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get gluon dir: %w", err)
|
||||
}
|
||||
|
||||
// Create the vault.
|
||||
vault, corrupt, err := vault.New(vaultDir, gluonDir, t.storeKey)
|
||||
vault, corrupt, err := vault.New(vaultDir, gluonCacheDir, t.storeKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create vault: %w", err)
|
||||
} else if corrupt {
|
||||
|
||||
Reference in New Issue
Block a user