From e0fc93701408dbb79b26c534e2a3816f8976046d Mon Sep 17 00:00:00 2001 From: JGiter Date: Fri, 8 Nov 2024 10:34:27 +0200 Subject: [PATCH] refactor: mark stale documents --- src/modules/did/did.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/did/did.service.ts b/src/modules/did/did.service.ts index 76e6ebd4..db01cf77 100644 --- a/src/modules/did/did.service.ts +++ b/src/modules/did/did.service.ts @@ -30,6 +30,7 @@ import { documentFromLogs, Resolver, mergeLogs, + addressOf, } from '@ew-did-registry/did-ethr-resolver'; import { EthereumDIDRegistry__factory } from '../../ethers/factories/EthereumDIDRegistry__factory'; import { EthereumDIDRegistry } from '../../ethers/EthereumDIDRegistry'; @@ -570,7 +571,7 @@ export class DIDService implements OnModuleInit, OnModuleDestroy { const staleDIDs = ( await this.didRepository.find({ select: ['id'] }) ).filter((doc) => { - const identity = doc.id.split(':')[3]; + const identity = addressOf(doc.id); return changedIdentities.includes(identity); }); await this.didSyncStatusRepository