TypeError: Cannot read property 'type' of undefined when handling response from sendMessageDIDCommAlpha1
See original GitHub issueBug severity 2
Describe the bug
TypeError: Cannot read property 'type' of undefined
resulting in not being able to validate Message + save it:
- When a cloud agent responds with a Message to local agent after
sendMessageDIDCommAlpha1
- When a cloud agent sends local agent a Message containing a VP requested by SDR via
sendMessageDIDCommAlpha1
To Reproduce Steps to reproduce the behaviour:
- Create VC and send it to a cloud agent with
sendMessageDIDCommAlpha1
- You will get an error upon receiving a response from the cloud agent
- Create a SDR with
createSelectiveDisclosureRequest
and send it to a cloud agent withsendMessageDIDCommAlpha1
- You will get an error upon receiving a response from the cloud agent
- Respond to SDR as cloud agent by doing the following:
getVerifiableCredentialForSdr
->createVerifiablePresentation
-> send its jwt viasendMessageDIDCommAlpha1
- Local agent will get the message from the cloud agent but errors out.
Quick way of reproducing This is a message received from the cloud agent: (as per DEBUG=*)
{
"raw":"{\"from\":\"did:web:lighthouse.bolte.id\",\"to\":\"did:web:veramo-klaus.herokuapp.com\",\"type\":\"jwt\",\"body\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJpYXQiOjE2MjM3NTM0MDUsInR5cGUiOiJzZHIiLCJ0YWciOiIxNTA2MjExMjM2IiwiY2xhaW1zIjpbeyJpc3N1ZXJzIjpbeyJkaWQiOiJkaWQ6d2ViOmxpZ2h0aG91c2UuYm9sdGUuaWQiLCJ1cmwiOiJodHRwczovL2xpZ2h0aG91c2UuYm9sdGUuaWQifV0sImNyZWRlbnRpYWxUeXBlIjoiUHJvZmlsZSIsImNsYWltVHlwZSI6Im5hbWUiLCJyZWFzb24iOiJXZSB3YW50IHRvIGNoZWNrIHlvdXIgZGVncmVlIGZvciB5b3VyIG5ldyBqb2IhIiwiZXNzZW50aWFsIjp0cnVlfV0sImlzcyI6ImRpZDp3ZWI6bGlnaHRob3VzZS5ib2x0ZS5pZCJ9.PzglNtd98QNFtj6ItCinystnrCSLcZ-snVIJFeHSmLdmUDsNnp5OM8wm9WUhGPL2BjOcFBw9GdBmsTt_gJ59Fw\",\"id\":\"f8f695a6-9932-48e1-957f-44ed498a135f\"}",
"metaData":[
{
"type":"DIDComm-sent"
}
],
"save":true
}
When using handleMessage
:
- on cloud agent, the message gets validated. No error.
- on local agent, I get
TypeError: Cannot read property 'type' of undefined
Observed behaviour See above.
Expected behaviour Response should be validated an saved to local agent.
Details I am pretty sure this is a problem on my side but am very unsure where this is coming from. When doing the same between two cloud agents (on Heroku), all works great.
Additional context Cloud agent is on Heroku
Two Debug logs:
- VC Creation + Sending (Cloud agents receives Message with VC fine (line 38) but local agent can’t handle response)
- SDR + Sending (Cloud agents receives Message with VC fine (line 36) but local agent can’t handle response)
My Veramo setup file How I spin up the local remote server How I inject the routes to express
Versions (please complete the following information):
- Veramo: 1.2.0 (also tried with @next on local agent)
- Node Version 14.15.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Wow, that was it. Thank you so much and sorry for bothering you! I wasn’t aware that order matters 😅 You can close the issue.
PS: I really, really like Veramo. Y’all are doing amazing work! 🎉 Can’t wait for LD proof support!
Thanks for making me aware of this part of the discussion page. As of right now, the project is not really in a presentable state but I’ll definitely will do it in a later stage! You’ll also probably have some good input. 🙂
One (not so) quick note: My project is not about interop, that’s been done before. The goal is to get an overview over multiple solutions in the space, select a few, and implement them in a reference implementation (loosely based on VC-HTTP-API as starting point) to see how much they cover the VC lifecycle. All learnings (+ expert questionnaires) will flow into an evaluation framework for SSI solutions that new developers can use as a starting point.