From 0226609a279303f5e8d09a2c01e54ff97cf61839 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Wed, 25 Aug 2021 12:24:57 +0200 Subject: [PATCH] fix: their did doc not ours (#436) --- packages/core/src/modules/routing/RecipientModule.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/modules/routing/RecipientModule.ts b/packages/core/src/modules/routing/RecipientModule.ts index 2c5bcc0dca..3bde76df2c 100644 --- a/packages/core/src/modules/routing/RecipientModule.ts +++ b/packages/core/src/modules/routing/RecipientModule.ts @@ -77,8 +77,9 @@ export class RecipientModule { const { message, connectionRecord } = await this.connectionService.createTrustPing(mediator.connectionId) const websocketSchemes = ['ws', 'wss'] - const hasWebSocketTransport = - connectionRecord.didDoc.didCommServices.filter((s) => websocketSchemes.includes(s.protocolScheme)).length > 0 + const hasWebSocketTransport = connectionRecord.theirDidDoc?.didCommServices?.some((s) => + websocketSchemes.includes(s.protocolScheme) + ) if (!hasWebSocketTransport) { throw new AriesFrameworkError('Cannot open websocket to connection without websocket service endpoint')