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

fix: decline proof #1435

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({
try {
const proofId = (notification as ProofExchangeRecord).id
if (agent) {
const connection = await agent.connections.findById(proofId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

ProofExchangeRecord has a connectionId

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oof. Yes, not sure what I was thinking here.

if (connection) {
await agent.proofs.sendProblemReport({ proofRecordId: proofId, description: t('ProofRequest.Declined') })
}

await agent.proofs.declineRequest({ proofRecordId: proofId })
}
} catch (err: unknown) {
Expand Down Expand Up @@ -268,11 +273,11 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({

// message.comment is the common fallback title for both v1 and v2 proof requests
let body: string = message?.comment ?? ''

if (message instanceof V1RequestPresentationMessage) {
body = message.indyProofRequest?.name ?? body
}

if (message instanceof V2RequestPresentationMessage) {
// workaround for getting proof request name in v2 proof request
// https://github.com/openwallet-foundation/credo-ts/blob/5f08bc67e3d1cc0ab98e7cce7747fedd2bf71ec1/packages/core/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts#L78
Expand Down
8 changes: 6 additions & 2 deletions packages/legacy/core/App/screens/ProofRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,11 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
const handleDeclineTouched = useCallback(async () => {
try {
if (agent && proof) {
await agent.proofs.sendProblemReport({ proofRecordId: proof.id, description: t('ProofRequest.Declined') })
const connection = await agent.connections.findById(proof.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

"

if (connection) {
await agent.proofs.sendProblemReport({ proofRecordId: proof.id, description: t('ProofRequest.Declined') })
}

await agent.proofs.declineRequest({ proofRecordId: proof.id })

if (proof.connectionId && goalCode && goalCode.endsWith('verify.once')) {
Expand Down Expand Up @@ -714,7 +718,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
{t('ProofRequest.SensitiveInformation')}
</InfoTextBox>
)}
{(!loading && proofConnectionLabel && goalCode === 'aries.vc.verify') && (
{!loading && proofConnectionLabel && goalCode === 'aries.vc.verify' && (
<ConnectionAlert connectionID={proofConnectionLabel} />
)}
{!loading && isShareDisabled() ? (
Expand Down