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

fix: send exn for each recipient; no early return #311

Conversation

kentbull
Copy link
Collaborator

Fixes #310 . The existing code would return early rather than execute for each recipient. This was okay from a functional perspective because of how KERIA acts as a delivery service for EXN messages. Yet, the way the code is written it indicates the for loop would execute for each member of the array, which is not how the code works because it returns early.

KERIA would take the list of recipients in the EXN message and then deliver all EXN messages as declared.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.71%. Comparing base (dbffa56) to head (74d4cb5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   83.70%   83.71%   +0.01%     
==========================================
  Files          48       48              
  Lines        4270     4273       +3     
  Branches     1054     1067      +13     
==========================================
+ Hits         3574     3577       +3     
  Misses        666      666              
  Partials       30       30              

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

@iFergal
Copy link
Contributor

iFergal commented Feb 12, 2025

I had attempted to fix this ages ago in #273 and never got the chance to revisit.

This doesn't work for end role auths as the notification won't appear unless they all sign the same exn, and putting individual member identifiers into each exn (rp) breaks this.

One approach might be to have a commitment on something internal to the exn and not the exn itself, but not sure how much that complicates other things.

The approach I discussed with @lenkan before was setting the rp field to the group identifier itself, and adjust KERIA calculate the other recipients to send it to. This also has the advantage of signing once at the edge, and one HTTP request.

@iFergal
Copy link
Contributor

iFergal commented Feb 12, 2025

Technically, we can just set the rp field to the group identifier right now, since I think it's the recipients parameter in the HTTP body that KERIA uses. But I believe the intention was to remove that parameter and always send to rp, and in this case KERIA could convert from rp -> otherGroupMembers.

@kentbull kentbull force-pushed the 310-fix-exchanges-send-execute-for-each-recp branch from 345e664 to 74d4cb5 Compare February 14, 2025 19:06
@kentbull kentbull closed this Feb 16, 2025
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.

Bug: Exchanges.send() should not return early and instead execute for each recipient
2 participants