From 10b70517bc4d41a75477a27b867506cbfba72b39 Mon Sep 17 00:00:00 2001 From: Jason Syrotuck Date: Wed, 25 Oct 2023 15:50:33 -0700 Subject: [PATCH 1/3] commo folder sync --- ...entialReducer.js => verifiableCredentialReducer.ts} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename services/core-web/common/reducers/{verifiableCredentialReducer.js => verifiableCredentialReducer.ts} (71%) diff --git a/services/core-web/common/reducers/verifiableCredentialReducer.js b/services/core-web/common/reducers/verifiableCredentialReducer.ts similarity index 71% rename from services/core-web/common/reducers/verifiableCredentialReducer.js rename to services/core-web/common/reducers/verifiableCredentialReducer.ts index 2569c421d1..4175c22d8a 100644 --- a/services/core-web/common/reducers/verifiableCredentialReducer.js +++ b/services/core-web/common/reducers/verifiableCredentialReducer.ts @@ -1,13 +1,19 @@ import * as actionTypes from "../constants/actionTypes"; import { VERIFIABLE_CREDENTIALS } from "../constants/reducerTypes"; +import { RootState } from "@/App"; +import { IVCInvitation, LOADING_STATUS } from "@mds/common"; /** * @file verifiableCredentialReducer.js * all data associated with verificable credential records. */ +interface verifiableCredentialState { + vcWalletConnectionInvitation: IVCInvitation; +} + const initialState = { - vcWalletConnectionInvitation: {}, + vcWalletConnectionInvitation: {} as IVCInvitation, }; const verifiableCredentialReducer = (state = initialState, action) => { @@ -26,7 +32,7 @@ const verifiableCredentialReducerObject = { [VERIFIABLE_CREDENTIALS]: verifiableCredentialReducer, }; -export const getVCWalletConnectionInvitation = (state) => +export const getVCWalletConnectionInvitation = (state: RootState) => state[VERIFIABLE_CREDENTIALS].vcWalletConnectionInvitation; export default verifiableCredentialReducerObject; From 32b072ff0832f214dda7ae7b735e3aa1d53bea82 Mon Sep 17 00:00:00 2001 From: Jason Syrotuck Date: Thu, 26 Oct 2023 09:22:37 -0700 Subject: [PATCH 2/3] log payload, not entire request --- .../resources/verifiable_credential_webhook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core-api/app/api/verifiable_credentials/resources/verifiable_credential_webhook.py b/services/core-api/app/api/verifiable_credentials/resources/verifiable_credential_webhook.py index 5350e9695e..49f9a2f260 100644 --- a/services/core-api/app/api/verifiable_credentials/resources/verifiable_credential_webhook.py +++ b/services/core-api/app/api/verifiable_credentials/resources/verifiable_credential_webhook.py @@ -17,7 +17,7 @@ class VerifiableCredentialWebhookResource(Resource, UserMixin): @api.doc(description='Endpoint to recieve webhooks from Traction.', params={}) def post(self, topic): - current_app.logger.warning(f"TRACTION WEBHOOK: {request.__dict__}") + current_app.logger.warning(f"TRACTION WEBHOOK: {request.args}") if topic == CONNECTIONS: invitation_id = request.args.get("invi_msg_id") vc_conn = PartyVerifiableCredentialConnection.query.unbound_unsafe().filter_by(invitation_id=invitation_id).first() From f922ea8dcdb3c740769fda8284c9b82730846594 Mon Sep 17 00:00:00 2001 From: Jason Syrotuck Date: Thu, 26 Oct 2023 09:29:08 -0700 Subject: [PATCH 3/3] do not include empty string connection_state when checking status --- services/core-api/app/api/parties/party/models/party.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core-api/app/api/parties/party/models/party.py b/services/core-api/app/api/parties/party/models/party.py index ee68d318e4..1000b6a98d 100644 --- a/services/core-api/app/api/parties/party/models/party.py +++ b/services/core-api/app/api/parties/party/models/party.py @@ -114,8 +114,9 @@ def business_roles_codes(self): @hybrid_property def digital_wallet_connection_status(self): - if self.digital_wallet_invitations: - return self.digital_wallet_invitations[0].connection_state # active >> invitation + dwi = [i for i in self.digital_wallet_invitations if i.connection_status] # filter empty conn_state + if dwi: + return dwi.connection_state # active >> invitation else: return None