-
Notifications
You must be signed in to change notification settings - Fork 207
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
refactor: resolve feedback for problem report #584
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export enum CommonMessageType { | ||
Ack = 'https://didcomm.org/notification/1.0/ack', | ||
ProblemReport = 'https://didcomm.org/notification/1.0/problem-report', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -733,7 +733,9 @@ export class CredentialService { | |
public async processProblemReport( | ||
messageContext: InboundMessageContext<CredentialProblemReportMessage> | ||
): Promise<CredentialRecord> { | ||
const { message: credentialProblemReportMessage, connection } = messageContext | ||
const { message: credentialProblemReportMessage } = messageContext | ||
|
||
const connection = messageContext.assertReadyConnection() | ||
|
||
this.logger.debug(`Processing problem report with id ${credentialProblemReportMessage.id}`) | ||
|
||
|
@@ -743,8 +745,8 @@ export class CredentialService { | |
) | ||
|
||
// Update record | ||
credentialRecord.errorMsg = `${credentialProblemReportMessage.description.code}: ${credentialProblemReportMessage.description.en}` | ||
await this.updateState(credentialRecord, CredentialState.None) | ||
credentialRecord.errorMessage = `${credentialProblemReportMessage.description.code}: ${credentialProblemReportMessage.description.en}` | ||
await this.updateState(credentialRecord, credentialRecord.state) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @TimoGlastra, If we update the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, see my comment above:
We should probably add a new event (e.g. {
payload: {
credentialRecord: { /* the record */ },
problemReportMessage: { /* the problem report message */ }
}
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can either add it to the current PR, or you can bypass it by listening for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TimoGlastra , As of now I have removed the test case and I will add it into upcoming PR with the problem-report events |
||
return credentialRecord | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './errors' | ||
export * from './messages' | ||
export * from './models' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum ProblemReportReason { | ||
MessageParseFailure = 'message-parse-failure', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ProblemReportReason' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state won't change, so I think we should just call the connection repository with update directly as this will emit a state changed event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, with the
None
state being removed, there is no way to determine that you received a problem report, so we should probably look into adding some events related to problem reports in follow up PRs