-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(did-comm): add trust ping protocol #1080
Conversation
packages/did-comm/src/__tests__/trust-ping-message-handler.test.ts
Outdated
Show resolved
Hide resolved
b9c63a5
to
b90359e
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #1080 +/- ##
==========================================
- Coverage 80.25% 79.74% -0.51%
==========================================
Files 118 132 +14
Lines 4056 4739 +683
Branches 875 1016 +141
==========================================
+ Hits 3255 3779 +524
- Misses 798 960 +162
+ Partials 3 0 -3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, kudos for the thorough testing!
It's a straight forward approach, using the message handler chain for this, and consistent with the existing codebase.
I'm not sure if this is a problem for this protocol, but this can be triggered by any message that looks like a trust ping, even if it doesn't come through didcomm.
Another possible approach for protocol implementations would be to create protocol handlers as agent plugins that react based on event listeners.
Maybe for future protocols we can also explore this option but we need to figure out how to forward events for agents that use @veramo/remote-client
That being said, now with a new message handler supported, we should also update our default CLI config file.
Yeah, it being able to be triggered by "non didcomm messages" was intentional. It at least makes testing a bit easier since it can be separated from didcomm's own message handler. I don't feel strongly though, but it seems fine to do it this way? I was considering using the event listener system as well, but it seemed to work well with the message handler flow. If we decide that other "didcomm protocols" should use the event system, I can refactor this one at that time. Made the small changes you requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Yeah, we can refactor to event system later, if needed.
Please also consider adding this new handler to the default CLI config
What issue is this PR fixing
closes #1079
What is being changed
A clear description of what this PR brings.
Quality
Check all that apply:
yarn
,yarn build
,yarn test
,yarn test:browser
locally.Details
If applicable, add screen captures, error messages or stack traces to help explain your problem.