credo-ts icon indicating copy to clipboard operation
credo-ts copied to clipboard

Error deleting AnonCreds credentials after upgrading from 0.4.2 to 0.5.3

Open bryce-mcmath opened this issue 1 year ago • 7 comments

Credo raises an error when attempting to delete a credential in 0.5.3 that was received in 0.4.2

Error originates in @credo-ts/anoncreds V1CredentialProtocol.ts [CredoError: Unsupported credential record type anoncreds for v1 issue credential protocol (need w3c)]

This occurs when calling agent.credentials.deleteById(credential.id) from Bifold. I might be wrong but I believe we were using V1 protocol with AnonCreds in Credo/AFJ 0.4.2 so I'm confused why it appears to no longer be supported.

Of credentialRecord.credentials the credentialRecord part seems to be deleted successfully but not the .credentials part. I think, higher up in Credo, it's failing during 'deleting associated credentials' loop here

Thank you for any help and let me know if I can provide more info or assist in any way

bryce-mcmath avatar May 27 '24 23:05 bryce-mcmath

Looking at the error you got, it looks like the credential exchange record was not properly migrated, so it is still bound to an anoncreds credential record instead of a w3c one.

It's a bit weird because this was fixed in https://github.com/openwallet-foundation/credo-ts/pull/1849, just before 0.5.3 was released. Actually, we did that fix right after @wadeking98 reported the very same issue on Discord.

Are you upgrading from 0.4.2 to 0.5.3 directly or did you pass by 0.5.0/0.5.1/0.5.2 in the middle?

genaris avatar May 28 '24 12:05 genaris

Hmm. I'm going directly from 0.4.2 to 0.5.3

I'll confer with @wadeking98 and make sure I'm not missing anything and then report back

bryce-mcmath avatar May 28 '24 15:05 bryce-mcmath

I'm able to reproduce this too, funny I thought it was fixed but maybe I was mistaken

wadeking98 avatar May 30 '24 00:05 wadeking98

@genaris @TimoGlastra any ideas? Any way we can help with this one?

bryce-mcmath avatar May 30 '24 16:05 bryce-mcmath

@genaris @TimoGlastra any ideas? Any way we can help with this one?

Could you give me some pointers to reproduce this issue easily? I've reproduced an upgrade from 0.4.2 to 0.5.3 with two credential exchanges: an Indy credential received with Issue Credential V1 protocol (taken from https://demo.animo.id) and a newer AnonCreds with Issue Credential V2 protocol (from 2060 chatbot demos) and both were succesfully found and updated to have the bindings to the w3c record.

I've tried also with BC Showcase but for some reason it is not working with Hologram app: it sends an 'abandoned' error when I request the credential. Weird, since it used to work fine not so long ago.

genaris avatar May 30 '24 20:05 genaris

I believe in this case (and in most of our ecosystem) it's all AnonCreds but with V1, so if you could try that combo hopefully you'll be able to repro.

@wadeking98 possible Traction issue with the showcase?

bryce-mcmath avatar May 30 '24 20:05 bryce-mcmath

For us to repro it, we basically install the last AFJ 0.4.2 version of Bifold or BC Wallet, get a credential from the showcase, and then upgrade to our latest development build (0.5.3) and attempt to delete the credential.

bryce-mcmath avatar May 30 '24 20:05 bryce-mcmath

@genaris running into an issue with the student showcase credential, try the lawyer/person credentials in the showcase

wadeking98 avatar May 31 '24 18:05 wadeking98

@genaris running into an issue with the student showcase credential, try the lawyer/person credentials in the showcase

Allright, so I could reproduce it by installing the tagged v1.0.16, receiving Lawyer and Person credentials, and then switching to main. After the fix in https://github.com/openwallet-foundation/credo-ts/pull/1887 it seems to work properly (I tested presenting the credentials and the deleting them).

I'll leverage all this environment setup to check also the Mobile Verifier issue that raised https://github.com/hyperledger/anoncreds-rs/pull/335. Hopefully we can get some proposal to fix it during next week. You are more than welcome to participate in next Credo contributor meeting (Thursday June 6th), as we may have some good discussion about this topic!

genaris avatar Jun 02 '24 01:06 genaris