Skip to content

Commit

Permalink
addAttempt workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
quanganhdo committed Nov 24, 2024
1 parent c28497d commit 714be83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ struct DataBrokerProfileQueryOperationManager: OperationsManager {
profileQueryId: profileQueryId)

try database.addAttempt(extractedProfileId: extractedProfileId,
attemptUUID: stageDurationCalculator.attemptId,
dataBroker: stageDurationCalculator.dataBroker,
lastStageDate: stageDurationCalculator.lastStateTime,
startTime: stageDurationCalculator.startTime)
attemptUUID: stageDurationCalculator.attemptId,
dataBroker: stageDurationCalculator.dataBroker,
lastStageDate: stageDurationCalculator.lastStateTime,
startTime: stageDurationCalculator.startTime)
try database.add(.init(extractedProfileId: extractedProfileId, brokerId: brokerId, profileQueryId: profileQueryId, type: .optOutRequested))
try incrementAttemptCountIfNeeded(
database: database,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,14 @@ final class DefaultDataBrokerProtectionDatabaseProvider: GRDBSecureStorageDataba

func save(_ optOutAttemptDB: OptOutAttemptDB) throws {
try db.write { db in
try optOutAttemptDB.insert(db)
// We originally intended for ExtractedProfileDB to have a one-to-many relationship with OptOutAttemptDB,
// but it somehow ended up as a one-to-one relationship instead.
//
// This serves as a temporary workaround to keep the opt-out retry mechanism functioning.
// We'll need to address this issue properly in the future.
//
// https://app.asana.com/0/1205591970852438/1208761697124514/f
try optOutAttemptDB.upsert(db)
}
}
}
Expand Down

0 comments on commit 714be83

Please sign in to comment.