Skip to content

Commit

Permalink
Profile load fix - check first for version compatibility (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
GhenadieVP committed May 18, 2023
1 parent f88f410 commit d60aa41
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/Clients/ProfileStore/ProfileStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,6 @@ extension ProfileStore {
)
}

do {
try await checkIfDeviceOwnsProfileSnapshot(decodedHeader)
} catch {
return .failure(.profileUsedOnAnotherDevice(error as! Profile.ProfileIsUsedOnAnotherDeviceError))
}

do {
try decodedHeader.validateCompatibility()
} catch {
Expand All @@ -466,6 +460,12 @@ extension ProfileStore {
))
}

do {
try await checkIfDeviceOwnsProfileSnapshot(decodedHeader)
} catch {
return .failure(.profileUsedOnAnotherDevice(error as! Profile.ProfileIsUsedOnAnotherDeviceError))
}

let profileSnapshot: ProfileSnapshot
do {
profileSnapshot = try jsonDecoder().decode(ProfileSnapshot.self, from: profileSnapshotData)
Expand Down

0 comments on commit d60aa41

Please sign in to comment.