hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
403 stars 510 forks source link

Running AliceWantsAJsonCredential.md demo results in two credentials in Alice wallet instead of one #2014

Closed swcurran closed 1 year ago

swcurran commented 1 year ago

Steps to replicate the problem:

Alice      | Credential: state = offer-received, cred_ex_id = 3b5902a2-5c2a-437d-a4a5-c99b9cdec60c

#15 After receiving credential offer, send credential request
Alice      | Credential: state = request-sent, cred_ex_id = 3b5902a2-5c2a-437d-a4a5-c99b9cdec60c
Alice      | Credential: state = credential-received, cred_ex_id = 3b5902a2-5c2a-437d-a4a5-c99b9cdec60c
Alice      | LD Credential: message = {'cred_ex_id': '3b5902a2-5c2a-437d-a4a5-c99b9cdec60c', 'updated_at': '2022-11-09T21:40:57.839917Z', 'created_at': '2022-11-09T21:40:57.839917Z', 'cred_id_stored': '8019139808a742f2b4a66936a24994b0', 'cred_ex_ld_proof_id': '13c3800d-7150-4133-9546-7af9d65b1bda'}
Alice      | Credential: state = done, cred_ex_id = 3b5902a2-5c2a-437d-a4a5-c99b9cdec60c
Alice      | LD Credential: message = {'cred_ex_id': '3b5902a2-5c2a-437d-a4a5-c99b9cdec60c', 'updated_at': '2022-11-09T21:40:58.972811Z', 'created_at': '2022-11-09T21:40:58.972811Z', 'cred_id_stored': '27f2396bae61486ebb82f0ff9ad1c0e0', 'cred_ex_ld_proof_id': 'cce16a56-f563-4177-885d-8977de427c6e'}
    (3) Send Message
    (4) Input New Invitation
    (X) Exit?                                                                                                                            
[3/4/X]                           

Execute with an empty ({}) payload the Alice endpoint POST /credentials/W3C and see that result shows an array of two credentials -- each the same.

Shouldn't there just be one credential?

Assuming this is an issue, not sure if it is in ACA-Py (although I suspect it is) or the demo controller.

swcurran commented 1 year ago

@shaangill025 , when you get a chance, please take a look. @ianco -- FYI.

ianco commented 1 year ago

If you just use the menu option (option 1 to send a credential) then a single credential is issued and only a single credential is stored in Alice wallet

Looking into the instructions ...

ianco commented 1 year ago

I think when you use the /issue-credential-2.0/send endpoint, because it automates the flow, you are getting the duplicate because the controllers are also responding to the webhooks. So for these instructions you should only use the /issue-credential-2.0/create-offer endpoint (or else you should run alice and faber with the --no-auto option.

@swcurran what's your preference?

swcurran commented 1 year ago

If we turn off auto processing, the presentation process will be harder, right, since that will no longer be automated? The /send on issue is kind of auto on the fly.

The create-offer sounds fine. It seems more confusing because we both have a controller and we have the --auto in ACA-Py.

Anyway -- up to you. I don't have a preference as long as it works :-)

ianco commented 1 year ago

Closing