Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(credentials): added credential sendProblemReport method #906

Conversation

Iskander508
Copy link
Contributor

Signed-off-by: Pavel Zarecky zarecky@procivis.ch

Adding a convenience method to send problem report as part of RFC's 0036 and 0453 unhappy flow.
It is a complementary implementation to the agent.proofs.sendProblemReport. But for credentials it was still missing.

Pavel Zarecky added 2 commits June 24, 2022 14:15
Signed-off-by: Pavel Zarecky <zarecky@procivis.ch>
Signed-off-by: Pavel Zarecky <zarecky@procivis.ch>
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2022

Codecov Report

Merging #906 (fbf9b16) into main (1366416) will decrease coverage by 0.07%.
The diff coverage is 35.29%.

@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
- Coverage   87.65%   87.57%   -0.08%     
==========================================
  Files         470      470              
  Lines       11172    11189      +17     
  Branches     1868     1869       +1     
==========================================
+ Hits         9793     9799       +6     
- Misses       1313     1323      +10     
- Partials       66       67       +1     
Impacted Files Coverage Δ
.../core/src/modules/credentials/CredentialsModule.ts 88.23% <0.00%> (-5.03%) ⬇️
.../modules/credentials/services/CredentialService.ts 100.00% <ø> (ø)
...les/credentials/protocol/v1/V1CredentialService.ts 93.29% <100.00%> (+0.05%) ⬆️
...les/credentials/protocol/v2/V2CredentialService.ts 89.87% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1366416...fbf9b16. Read the comment docs.

@Iskander508 Iskander508 marked this pull request as ready for review June 24, 2022 13:02
@Iskander508 Iskander508 requested a review from a team as a code owner June 24, 2022 13:02
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @Iskander508!

@@ -67,6 +67,7 @@ export interface CredentialsModule<CFs extends CredentialFormat[], CSs extends C

// Credential
acceptCredential(options: AcceptCredentialOptions): Promise<CredentialExchangeRecord>
sendProblemReport(credentialRecordId: string, message: string): Promise<CredentialExchangeRecord>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can also make this an object like we do with the other methods that contain both the credentialRecordId and message? Mainly for two reasons:

  1. Consistency with other methods
  2. It would allow to add more options in the future without needing to make a breaking change (we'll probably want to make it an options object when adding more options)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimoGlastra refactored

@@ -84,6 +84,9 @@ export abstract class CredentialService<CFs extends CredentialFormat[] = Credent
// methods for ack
abstract processAck(messageContext: InboundMessageContext<AgentMessage>): Promise<CredentialExchangeRecord>

// methods for problem-report
abstract createProblemReport(message: string): ProblemReportMessage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, if we make it an object it would be easier to add new properties later on (such as exposing the code)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored

Signed-off-by: Pavel Zarecky <zarecky@procivis.ch>
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@TimoGlastra
Copy link
Contributor

@Iskander508 I'll merge this once #908 is merged

@TimoGlastra TimoGlastra added this to the v0.2.1 milestone Jun 28, 2022
@TimoGlastra TimoGlastra enabled auto-merge (squash) June 28, 2022 09:28
@TimoGlastra TimoGlastra merged commit 90dc7bb into openwallet-foundation:main Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants