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 connection record response for mobile #1469

Merged
merged 8 commits into from
Dec 6, 2021

Conversation

ianco
Copy link
Contributor

@ianco ianco commented Nov 1, 2021

Signed-off-by: Ian Costanzo ian@anon-solutions.ca

See issue: #1441

This is a bit of a shot in the dark, the connection auto-replies aren't following the same convention as other protocols.

Signed-off-by: Ian Costanzo <ian@anon-solutions.ca>
@TimoGlastra
Copy link
Contributor

@ianco Does this fix #1372? I don't see any code related to this issue

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2021

Codecov Report

Merging #1469 (eec51a1) into main (26d23bf) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1469      +/-   ##
==========================================
- Coverage   95.73%   95.71%   -0.03%     
==========================================
  Files         527      527              
  Lines       32375    32372       -3     
==========================================
- Hits        30994    30984      -10     
- Misses       1381     1388       +7     

@ianco ianco marked this pull request as draft November 3, 2021 14:54
@ianco
Copy link
Contributor Author

ianco commented Nov 3, 2021

@ianco Does this fix #1372? I don't see any code related to this issue

Hi @TimoGlastra I think you're right. I thought it may be related because you're dealing with connections but upon review I feel that it's a different issue

@seriousManual @ntsbs do you think this will resolve your issue #1441 ?

I've changed the PR to Draft status because I think the issue may be more complicated. Responses can be initiated in the routes class (called from admin api), one of the handlers (response to a message from another agent) or within the manager class (common to both).

I think the issue here was that the response initiated within the manager class explicitly referenced the mediator, whereas the response initiated within the handler "knows" that there is an open session to return the response.

This issue may come up for other types of transactions as well, @swcurran @andrewwhitehead @shaangill025 any thoughts?

@seriousManual
Copy link

@seriousManual @ntsbs do you think this will resolve your issue #1441 ?

Honestly I don't know.
I'm not really familiar with Python in general and the aca-py code base, so I can't tell if this is related at all.

@ianco
Copy link
Contributor Author

ianco commented Nov 3, 2021

@seriousManual @ntsbs do you think this will resolve your issue #1441 ?

Honestly I don't know. I'm not really familiar with Python in general and the aca-py code base, so I can't tell if this is related at all.

Can we test this out somehow? Can you build an aca-py docker image with the updated code? Or if not maybe I can build/publish a docker image for you?

@seriousManual
Copy link

Hi @ianco , if you could an image that would be awesome!

@ianco
Copy link
Contributor Author

ianco commented Nov 8, 2021

Hi @ianco , if you could an image that would be awesome!

Hi @seriousManual you can try running with this image:

https://hub.docker.com/layers/anonsolutions/aries-cloudagent/py36-1.16-1_0.7.2-rc1/images/sha256-2f880b93bb09d0ff6dad79d190c85bec80e21ee7df3c0192d3aae4bb642e609f?context=explore

If you want to build an image yourself, I can send some instructions, just let me know.

@seriousManual
Copy link

Hey Ian,
we deployt the Image and ran it aganst the wallet app, the error persists unfortunately.

@ianco
Copy link
Contributor Author

ianco commented Nov 15, 2021

Hey Ian, we deployt the Image and ran it aganst the wallet app, the error persists unfortunately.

OK thanks, back to the drawing board ...

@dbluhm
Copy link
Contributor

dbluhm commented Dec 2, 2021

This actually solves a problem we're experiencing with the toolbox and ACA-Py 0.7.2. With the session -> profile changes made wherever possible, I found that the BaseResponder instance now available for use in the ConnectionsManager was an AdminResponder rather than the DispatcherResponder from the message currently being processed so it lost the reply_to_verkey that is held in the DispatcherResponder and made it unable to respond to the HTTP session.

@dbluhm
Copy link
Contributor

dbluhm commented Dec 2, 2021

This instance appears to be the only time where a BaseResponder instance is injected and send_reply is attempted so in theory there shouldn't be other lurking problems. However, this feels like a gotcha that's going to get me again in the future lol. What dependencies are available in what injection context and when has lost a significant amount of clarity for me since we now have contexts, profiles, and sessions of various types to consider.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm
Copy link
Contributor

dbluhm commented Dec 2, 2021

This also appears to impact the auto_accept condition of the DID Exchange manager receive_request.

@dbluhm
Copy link
Contributor

dbluhm commented Dec 2, 2021

Unfortunately, I think this is a critical bug for using ACA-Py 0.7.2 with agents without endpoints (mobile agent, toolbox, etc.) as it renders them unable to connect.

@ianco ianco marked this pull request as ready for review December 2, 2021 15:31
@ianco ianco requested a review from dbluhm December 2, 2021 15:32
@ianco
Copy link
Contributor Author

ianco commented Dec 2, 2021

Hey @dbluhm thanks for the comments, I wasn't sure if this was an issue, it was a stab in the dark to fix a different issue (which it didn't even fix)

Instead of didexchange manager.receive_request

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
dbluhm
dbluhm previously approved these changes Dec 3, 2021
Copy link
Contributor

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

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

These changes have fixed errors we were experiencing; however, seems like it would be beneficial to get someone else's eyes on this since I contributed some of these changes.

shaangill025
shaangill025 previously approved these changes Dec 3, 2021
Copy link
Contributor

@shaangill025 shaangill025 left a comment

Choose a reason for hiding this comment

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

Looks good, may be tests can be updated to cover recent changes made to:

  • connections/v1_0/handlers/connection_request_handler.py
  • didexchange/v1_0/handlers/request_handler.py

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm dismissed stale reviews from shaangill025 and themself via eec51a1 December 3, 2021 17:00
@swcurran swcurran merged commit 5f8b75a into openwallet-foundation:main Dec 6, 2021
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.

7 participants