From d2f626d543b4c372adc3e06cf6cb14d1e8bf74a5 Mon Sep 17 00:00:00 2001 From: Ethan Sung Date: Fri, 16 Feb 2024 17:21:11 +0900 Subject: [PATCH] Add log --- aries_cloudagent/core/dispatcher.py | 13 +++++++++++++ .../protocols/connections/v1_0/manager.py | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/aries_cloudagent/core/dispatcher.py b/aries_cloudagent/core/dispatcher.py index 2193dd20b9..e13326451d 100644 --- a/aries_cloudagent/core/dispatcher.py +++ b/aries_cloudagent/core/dispatcher.py @@ -216,6 +216,9 @@ async def handle_message( outcome="Dispatcher.handle_message.START", ) + if "connections/1.0/request" in inbound_message.receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "start handle_message") + context = RequestContext(profile) context.message = message context.message_receipt = inbound_message.receipt @@ -230,6 +233,9 @@ async def handle_message( context.injector.bind_instance(BaseResponder, responder) + if "connections/1.0/request" in inbound_message.receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after responder") + # When processing oob attach message we supply the connection id # associated with the inbound message if inbound_message.connection_id: @@ -237,12 +243,16 @@ async def handle_message( connection = await ConnRecord.retrieve_by_id( session, inbound_message.connection_id ) + if "connections/1.0/request" in inbound_message.receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after retrieve_by_id") else: connection_mgr = ConnectionManager(profile) connection = await connection_mgr.find_inbound_connection( inbound_message.receipt ) del connection_mgr + if "connections/1.0/request" in inbound_message.receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after find_inbound_connection") if connection: inbound_message.connection_id = connection.connection_id @@ -264,6 +274,9 @@ async def handle_message( handler = self.collector.wrap_coro(handler, [handler.__qualname__]) await handler(context, responder) + if "connections/1.0/request" in inbound_message.receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after handle") + trace_event( self.profile.settings, context.message, diff --git a/aries_cloudagent/protocols/connections/v1_0/manager.py b/aries_cloudagent/protocols/connections/v1_0/manager.py index 62c81ddcdc..a4ce69f7ab 100644 --- a/aries_cloudagent/protocols/connections/v1_0/manager.py +++ b/aries_cloudagent/protocols/connections/v1_0/manager.py @@ -38,6 +38,7 @@ from .messages.problem_report import ProblemReportReason from .models.connection_detail import ConnectionDetail +LOGGER = logging.getLogger(__name__) class ConnectionManagerError(BaseError): """Connection error.""" @@ -1156,6 +1157,9 @@ async def resolve_inbound_connection(self, receipt: MessageReceipt) -> ConnRecor """ + if "connections/1.0/request" in receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "start resolve_inbound_connection") + if receipt.sender_verkey: try: receipt.sender_did = await self.find_did_for_key(receipt.sender_verkey) @@ -1166,6 +1170,9 @@ async def resolve_inbound_connection(self, receipt: MessageReceipt) -> ConnRecor receipt.sender_verkey, ) + if "connections/1.0/request" in receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after find_did_for_key") + # # SKT: temp, skip issuers that use non-public invitation # if receipt.recipient_verkey: issuer_list_non_public = ["1957", "2848"] @@ -1197,6 +1204,9 @@ async def resolve_inbound_connection(self, receipt: MessageReceipt) -> ConnRecor receipt.recipient_verkey, ) + if "connections/1.0/request" in receipt.raw_message: + LOGGER.info("TEMP_LOG_0629 " + "after get_local_did_for_verkey") + return await self.find_connection( receipt.sender_did, receipt.recipient_did, receipt.recipient_verkey, True )