From 53f567c9cb16a6b8d90a09a59bbbac1c3fe1d730 Mon Sep 17 00:00:00 2001 From: Ethan Sung Date: Tue, 20 Feb 2024 14:27:10 +0900 Subject: [PATCH] Do not raise to handle temporal duplicate RECORD_TYPE_DID_DOC --- aries_cloudagent/storage/askar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aries_cloudagent/storage/askar.py b/aries_cloudagent/storage/askar.py index 2a48cfb2a7..da681bf9c8 100644 --- a/aries_cloudagent/storage/askar.py +++ b/aries_cloudagent/storage/askar.py @@ -1,4 +1,5 @@ """Aries-Askar implementation of BaseStorage interface.""" +import logging from typing import Mapping, Sequence @@ -21,6 +22,8 @@ ) from .record import StorageRecord +LOGGER = logging.getLogger(__name__) + class AskarStorage(BaseStorage): """Aries-Askar Non-Secrets interface.""" @@ -164,7 +167,9 @@ async def find_record( except AskarError as err: raise StorageError("Error when finding storage record") from err if len(results) > 1: - raise StorageDuplicateError("Duplicate records found") + # SKT: Do not raise to handle temporal duplicate RECORD_TYPE_DID_DOC (will be removed by logic) + LOGGER.error("Duplicate records found - Use first record - type_filter: %s", type_filter) + # raise StorageDuplicateError("Duplicate records found") if not results: raise StorageNotFoundError("Record not found") row = results[0]