Skip to content

Commit d7f14aa

Browse files
committed
Read updated profiles from function argument
Coming from a "will" publisher, the value in ProfileRepository is not up-to-date. Use the function argument instead. Fixes #367
1 parent cc6c8a9 commit d7f14aa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## 2.2.1 (2023-10-14)
9+
10+
### Fixed
11+
12+
- Persisted profile is overwritten with its former value. [#367](https://github.com/passepartoutvpn/passepartout-apple/issues/367)
913

1014
## 2.2.0 (2023-10-10)
1115

PassepartoutLibrary/Sources/PassepartoutVPN/Managers/ProfileManager.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ extension ProfileManager {
371371
currentProfile.value = .placeholder
372372
}
373373

374-
let newProfile = profileRepository.profile(withId: currentProfile.value.id)
375-
if let newProfile = newProfile, newProfile != currentProfile.value {
374+
if let newProfile = newProfiles[currentProfile.value.id], newProfile != currentProfile.value {
376375
pp_log.info("Current profile remotely updated")
377376
currentProfile.value = newProfile
378377
}

0 commit comments

Comments
 (0)