openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
260 stars 197 forks source link

Unable to accept credential offer as of 0.2.0-alpha.20 #647

Closed jleach closed 1 year ago

jleach commented 2 years ago

As of commit c5febf5d AriesBifold is not able to accept credential offers. This commit is where AFJ was updated to the latest alpha release:

-    "@aries-framework/core": "^0.1.0-alpha.322",
+    "@aries-framework/core": "^0.2.0-alpha.20",
     "@aries-framework/react-hooks": "^0.1.2",
-    "@aries-framework/react-native": "^0.1.0-alpha.322",
+    "@aries-framework/react-native": "^0.2.0-alpha.20",

To reproduce the issue locally I run:

  1. npx ngrok http 8020
  2. git clone https://github.com/hyperledger/aries-cloudagent-python
  3. cd demo
  4. export LEDGER_URL=http://test.bcovrin.vonx.io
  5. export PUBLIC_TAILS_URL=$(curl -s http://localhost:4040/api/tunnels | jq -r '[.tunnels[] | select(.proto == "https")][0].public_url')&& echo $PUBLIC_TAILS_URL && ./run_demo faber --aip 10 --events --revocation
  6. In the Bifold repo npm i && cd ios && pod install && cd - then do a clean and build in Xcode with a release config.
  7. Scan the connection QR that will show up;
  8. Press 1 to issue a credential
  9. Review and accept the offer in AriesBifold
  10. That's it
2022-02-18 11:09:35.050327-0800 AriesBifold[6696:1728891] [javascript] 'TRACE: Error retrieving did \'TG2TSLVkqfJ5X5X53MtY5i\' from ledger \'CandyDev\'', '{\n  "error": {\n    "name": "IndyError",\n    "message": "IndySdk: Error Domain=IndyErrorDomain Code=309 \\"(null)\\" UserInfo={message=Error: Item not found on ledger\\n  Caused by: Nym not found\\n, indy_backtrace=}",\n    "indyCode": 309,\n    "indyName": "LedgerNotFound",\n    "indyCurrentErrorJson": null\n  },\n  "did": "TG2TSLVkqfJ5X5X53MtY5i"\n}'
2022-02-18 11:09:35.050904-0800 AriesBifold[6696:1728891] [javascript] 'TRACE: Retrieved did \'TG2TSLVkqfJ5X5X53MtY5i\' from ledger \'BCovrinTest\'', '{\n  "did": "TG2TSLVkqfJ5X5X53MtY5i",\n  "verkey": "FK6puHKtLXdZfyz1bXtkxnyc1qtJcBeZ6jqVsvMgjxow",\n  "role": "101"\n}'
2022-02-18 11:09:35.071320-0800 AriesBifold[6696:1728891] [javascript] 'TRACE: Error retrieving did \'TG2TSLVkqfJ5X5X53MtY5i\' from ledger \'IndicioTestNet\'', '{\n  "error": {\n    "name": "IndyError",\n    "message": "IndySdk: Error Domain=IndyErrorDomain Code=309 \\"(null)\\" UserInfo={message=Error: Item not found on ledger\\n  Caused by: Nym not found\\n, indy_backtrace=}",\n    "indyCode": 309,\n    "indyName": "LedgerNotFound",\n    "indyCurrentErrorJson": null\n  },\n  "did": "TG2TSLVkqfJ5X5X53MtY5i"\n}'
2022-02-18 11:09:35.473129-0800 AriesBifold[6696:1728891] [javascript] 'TRACE: Error retrieving did \'TG2TSLVkqfJ5X5X53MtY5i\' from ledger \'SovrinBuilderNet\'', '{\n  "error": {\n    "name": "IndyError",\n    "message": "IndySdk: Error Domain=IndyErrorDomain Code=309 \\"(null)\\" UserInfo={message=Error: Item not found on ledger\\n  Caused by: Nym not found\\n, indy_backtrace=}",\n    "indyCode": 309,\n    "indyName": "LedgerNotFound",\n    "indyCurrentErrorJson": null\n  },\n  "did": "TG2TSLVkqfJ5X5X53MtY5i"\n}'

The did above is from the Allies-Faber-ACME demo and DID TG2TSLVkqfJ5X5X53MtY5i is the Faber Agent (which is a Faux university issuing a credential).

jleach commented 2 years ago

@JamesKEbert @TimoGlastra FYI.

berendsliedrecht commented 2 years ago

I am not too sure what is going on but the tests seem to work still fine. Which version is mentioned in the package.lock? on alpha.20 revocation for prover and verifier has been added.

Might be some React Native issues as we don't test that environment? Unfortunately I do not know too much to help you out.

JamesKEbert commented 2 years ago

@TheTreek & I were able to recreate the issue--we've determined it's caused by the asynchronous ledger loading addition in AFJ (#580). So, adding connectToIndyLedgersOnStartup: false will work as a quick fix while we do some deeper investigation. I'll open a PR to Bifold until this can be resolved. The really odd thing here is we've got another application that we've used iOS release builds with that is using the asynchronous ledger loading just fine--so I'm wondering if there's a small config difference between the two somewhere.

TimoGlastra commented 2 years ago

Great job on finding the cause @JamesKEbert. That's a really weird issue... Not sure why connecting on startup would have any impact on this

TimoGlastra commented 2 years ago

@JamesKEbert were you able to determine what is causing this issue? connectToIndyLedgersOnStartup is set to true by default, so would be good to have this fixed before we release 0.2.0

JamesKEbert commented 2 years ago

We unfortunately got pulled to other work so we have not identified the issue here yet--but I can add this as an item to work on here soon. One of the issues we were running into is having difficulty extracting the logs from the device (as the iOS Release makes this challenging). If there's any recommendations on how to do so I'm all ears. :)

We could also change the default setting before release 0.2.0 to not hold the release up if we need to.