bifold-wallet
bifold-wallet copied to clipboard
feat: use AFJ react hooks to listen for revocation
Signed-off-by: ryankoch13 [email protected]
Summary of Changes
This PR removes the old management of revocation notification using the context providers and instead uses the new AFJ and react hook functionality to detect if a credential is revoked. Once a credential is revoked, a new notification will appear on the Home screen. If the credential details is viewed for the revoked credential it will add a metadata property to get rid of the notification.
It should be noted that the "CredentialRevokedMessageTitle" was edited and a new string was added to the English localization file. Please let me know if anyone has suggestions on how to avoid these changes or update the other translation files to match.
Related Issues
Please reference here any issue #'s that are relevant to this PR, or simply enter "N/A" if this PR does not relate to any existing issues.
Pull Request Checklist
Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.
- [x] All commits contain a DCO
Signed-off-by
line (we use the DCO GitHub app to enforce this); - [x] Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
- [x] Updated documentation as needed for changed code and new or modified features;
- [x] Added sufficient tests so that overall code coverage is not reduced.
If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
Pro Tip 🤓
- Read our contribution guide at least once; it will save you a few review cycles!
- Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.
PR template adapted from the Python attrs project.
Seems like the linter is failing. Are we referencing the correct types?
@ryankoch13 I think you can run these tests locally and fix 'em in one swoop. Normally husky runs them on as a pre-commit hook so you can't commit unless linting and typechecking are ok. Might be broken on your dev machine. In any case, I think you can run:
npm run pre-commit-lint
npm run typecheck
or
npm run lint
npm run prettier
npm run typecheck
@ryankoch13 I think if you just change 2 -> 3 in the 2nd failing test and update findByText('Home.Notifications (2)')
to be findByText('Home.Notifications (3)')
it should pass the tests.
@ryankoch13 Feel free to do the honours and merge the PR. Thanks for your efforts on this!
@amanji No, thank you for your patience and help getting it all cleaned up! I swear I will get my dev environment working again so I can fix these tests before I push up next time
The old PR's I did for bifold were with a different github ID so I don't have permissions to merge yet :(
Hi @ryankoch13 @amanji @jleach
After revoking a credential from agent side, We are using following attributes in Revoke APi { "comment": "string", "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "cred_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "cred_rev_id": "12345", "notify": true, "notify_version": "v1_0", "publish": true, "rev_reg_id": "WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0", "thread_id": "string" } But I am not receiving any notification for revoked credential in the app. Instead I am getting the following error in the console:
WARN WARN: Failed to process revocation notification message { "error": { "name": "AriesFrameworkError", "message": "Incorrect revocation notification threadId format: \n79389b4b-efc4-425e-b951-3e5ed07ecd5f\ndoes not match\n"indy::<revocation_registry_id>::<credential_revocation_id>"", "stack": "Error\n at captureStackTrace (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:114073:32)\n%5Cn) at BaseError (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:114111:22)\n%5Cn) at construct (native)\n at _createSuperInternal (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:114012:406)\n%5Cn) at call (native)\n at BaseError (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:114032:26)\n%5Cn) at construct (native)\n at _createSuperInternal (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:113991:406)\n%5Cn) at call (native)\n at AriesFrameworkError (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:114004:25)\n%5Cn) at v1ProcessRevocationNotification$ (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:185308:121)\n%5Cn) at call (native)\n at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20534:23)\n%5Cn) at invoke (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20680:32)\n%5Cn) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20574:30)\n%5Cn) at call (native)\n at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20534:23)\n%5Cn) at invoke (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20599:30)\n%5Cn) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20624:19)\n%5Cn) at tryCallTwo (/tmp/hermes/staging/hermes/cmake/intlDebug/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)\n at doResolve (/tmp/hermes/staging/hermes/cmake/intlDebug/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:216:25)\n at Promise (/tmp/hermes/staging/hermes/cmake/intlDebug/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:82:14)\n at callInvokeWithMethodAndArg (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20623:33)\n%5Cn) at enqueue (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20627:157)\n%5Cn) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20574:30)\n%5Cn) at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:20641:69)\n%5Cn) at v1ProcessRevocationNotification ([http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.ariesbifold&modulesOnly=false&runModule=true:185295:82)\n](http://localhost:8081/index.bundle? }, "threadId": "79389b4b-efc4-425e-b951-3e5ed07ecd5f" }
Can anyone help in what I might be doing wrong?