credo-ts
credo-ts copied to clipboard
Delete tags when deleting a record item
It seems tags are not autmoatically deleted when deleting a record, so we should add this to the IndyStorageService: https://github.com/hyperledger/indy-sdk/tree/master/wrappers/nodejs#deletewalletrecordtags--wh-type-id-tagnames----void
- Create small PoC to test if tags are deleted (see below)
- If the tags are not deleted, delete tags when deleting a record in the
IndyStorageService.tsfile (using https://github.com/hyperledger/indy-sdk/tree/master/wrappers/nodejs#deletewalletrecordtags--wh-type-id-tagnames----void).
PoC
- Create new project, add indy-sdk as dependency
- Create a new wallet and open it (See https://github.com/hyperledger/aries-framework-javascript/blob/main/packages/node/bin/is-indy-installed.js#L9 for how to create a wallet, see https://github.com/hyperledger/indy-sdk/tree/master/wrappers/nodejs#openwallet--config-credentials----handle on how to open a wallet).
- Open the wallet database in a SQLite viewer (located in
~/.indy_client/wallet/<wallet-name>/sqlite.db). - Add a new record in the wallet with tags (https://github.com/hyperledger/indy-sdk/tree/master/wrappers/nodejs#addwalletrecord--wh-type-id-value-tags----void)
- Check to see if the tags are added in the sqlite viewer
- Delete the record (https://github.com/hyperledger/indy-sdk/tree/master/wrappers/nodejs#deletewalletrecord--wh-type-id----void)
- Check to see if the tags are deleted in the sqlite viewer
Where does it show that the tags are not deleted when a record is deleted? Maybe you can just delete the tags without deleting the record. I am trying to find it in the indy-sdk code but thats not the easiest place to look.
The .NET framework does it: https://cs.github.com/hyperledger/aries-framework-dotnet/blob/8f5748bf8517d5d4488e632eac9a68938ee2c168/src/Hyperledger.Aries/Storage/DefaultWalletRecordService.cs?q=repo%3Ahyperledger%2Faries-framework-dotnet+deleteAsync#L126-L130
But yeah could be that it is automatically done. However you also need to store and update them separately, so wouldn't surprise me if you also need to delete them manually
The .NET framework does it: https://cs.github.com/hyperledger/aries-framework-dotnet/blob/8f5748bf8517d5d4488e632eac9a68938ee2c168/src/Hyperledger.Aries/Storage/DefaultWalletRecordService.cs?q=repo%3Ahyperledger%2Faries-framework-dotnet+deleteAsync#L126-L130
But yeah could be that it is automatically done. However you also need to store and update them separately, so wouldn't surprise me if you also need to delete them manually
AH yeah storing and updating seperately implies that. Maybe a quick test with creating a record with some tags, deleting the record and trying to fetch by tags?
Indy SDK has been removed