diff --git a/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts b/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts index 56a6845eb..e8555591c 100644 --- a/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts +++ b/packages/services/src/Domain/Encryption/UseCase/TypeA/DecryptErroredPayloads.ts @@ -6,18 +6,14 @@ import { PayloadEmitSource, SureFindPayload, } from '@standardnotes/models' +import { isErrorDecryptingParameters } from '@standardnotes/encryption' import { PayloadManagerInterface } from '../../../Payloads/PayloadManagerInterface' -import { isErrorDecryptingParameters, EncryptionOperatorsInterface } from '@standardnotes/encryption' import { DecryptTypeAPayloadWithKeyLookup } from './DecryptPayloadWithKeyLookup' -import { RootKeyManager } from '../../../RootKeyManager/RootKeyManager' -import { KeySystemKeyManagerInterface } from '../../../KeySystem/KeySystemKeyManagerInterface' export class DecryptErroredTypeAPayloads { constructor( private payloads: PayloadManagerInterface, - private operatorManager: EncryptionOperatorsInterface, - private keySystemKeyManager: KeySystemKeyManagerInterface, - private rootKeyManager: RootKeyManager, + private _decryptTypeAPayloadWithKeyLookup: DecryptTypeAPayloadWithKeyLookup, ) {} async execute(): Promise { @@ -29,12 +25,7 @@ export class DecryptErroredTypeAPayloads { return } - const usecase = new DecryptTypeAPayloadWithKeyLookup( - this.operatorManager, - this.keySystemKeyManager, - this.rootKeyManager, - ) - const resultParams = await usecase.executeMany(erroredRootPayloads) + const resultParams = await this._decryptTypeAPayloadWithKeyLookup.executeMany(erroredRootPayloads) const decryptedPayloads = resultParams.map((params) => { const original = SureFindPayload(erroredRootPayloads, params.uuid) diff --git a/packages/snjs/lib/Application/Dependencies/Dependencies.ts b/packages/snjs/lib/Application/Dependencies/Dependencies.ts index 1e05dc9ef..d41fd53ac 100644 --- a/packages/snjs/lib/Application/Dependencies/Dependencies.ts +++ b/packages/snjs/lib/Application/Dependencies/Dependencies.ts @@ -755,9 +755,7 @@ export class Dependencies { this.factory.set(TYPES.DecryptErroredTypeAPayloads, () => { return new DecryptErroredTypeAPayloads( this.get(TYPES.PayloadManager), - this.get(TYPES.EncryptionOperators), - this.get(TYPES.KeySystemKeyManager), - this.get(TYPES.RootKeyManager), + this.get(TYPES.DecryptTypeAPayloadWithKeyLookup), ) })