From 81ba2ef6a13322ec2f19efd128055c8e660d3e07 Mon Sep 17 00:00:00 2001 From: Anh Do <18567+quanganhdo@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:08:19 -0500 Subject: [PATCH] Hotfix for schedulingConfig decoding issue (#3624) Task/Issue URL: https://app.asana.com/0/0/1208895860990675/f Tech Design URL: CC: **Description**: This fixes an error with JSON decoding preventing PIR to save profile. **Optional E2E tests**: - [x] Run PIR E2E tests Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this. **Steps to test this PR**: 1. Test PIR on a fresh install 2. Test PIR on macOS 1.115.0 upgrading to this version **Definition of Done**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? --- ###### Internal references: [Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f) [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) [Pull Request Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f) --- .../Sources/DataBrokerProtection/Model/DataBroker.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DataBroker.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DataBroker.swift index 269eea17d8..4d87ae1416 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DataBroker.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DataBroker.swift @@ -174,7 +174,12 @@ public struct DataBroker: Codable, Sendable { version = try container.decode(String.self, forKey: .version) steps = try container.decode([Step].self, forKey: .steps) - schedulingConfig = try container.decode(DataBrokerScheduleConfig.self, forKey: .schedulingConfig) + // Hotfix for https://app.asana.com/0/1203581873609357/1208895331283089/f + do { + schedulingConfig = try container.decode(DataBrokerScheduleConfig.self, forKey: .schedulingConfig) + } catch { + schedulingConfig = .init(retryError: 48, confirmOptOutScan: 72, maintenanceScan: 120, maxAttempts: -1) + } parent = try? container.decode(String.self, forKey: .parent) do {