Skip to content
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): sendDIDCommMessage - returnMessage #1283

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

simonas-notcat
Copy link
Contributor

What is being changed

A return message will be included in the response to sendDIDCommMessage when return_route: 'all' is used in a packed message

const messageId = v4()
const packedMessage = await agent.packDIDCommMessage({ 
  message: {
    type: 'example',
    from: senderDid,
    to: recipientDidUrl,
    id: messageId,
    body: {},
    return_route: 'all'
  },
  packing: 'authcrypt'
})
const { returnMessage, transportId } = await agent.sendDIDCommMessage({ 
  packedMessage, messageId, recipientDidUrl
})

console.log(returnMessage)

Quality

Check all that apply:

  • I want these changes to be integrated
  • I successfully ran pnpm i, pnpm build, pnpm test, pnpm test:browser locally.
  • I allow my PR to be updated by the reviewers (to speed up the review process).
  • I added unit tests.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ba88d6b) 84.98% compared to head (0acf227) 85.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1283      +/-   ##
==========================================
+ Coverage   84.98%   85.00%   +0.01%     
==========================================
  Files         167      167              
  Lines       18140    18154      +14     
  Branches     2040     2040              
==========================================
+ Hits        15417    15431      +14     
  Misses       2723     2723              
Files Coverage Δ
packages/did-comm/src/didcomm.ts 85.65% <100.00%> (+0.21%) ⬆️
...d-comm/src/protocols/trust-ping-message-handler.ts 89.88% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a tiny change that needs to be made to the inline doc of the sendDIDCommMessage method to align with the changes.

Since the API of the method is changing we'll need to mark this as a breaking change and include it in the next major release.

packages/did-comm/src/types/IDIDComm.ts Outdated Show resolved Hide resolved
@mirceanis mirceanis merged commit f7a3851 into next Nov 1, 2023
9 checks passed
@mirceanis mirceanis deleted the feat/did-comm-return-response-message branch November 1, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants