-
Notifications
You must be signed in to change notification settings - Fork 155
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
fix: decline proof #1435
Conversation
Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
@@ -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) |
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.
This method expects a connectionId
no? Will a proofId
work as expected? Are the two always the same?
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.
ProofExchangeRecord
has a connectionId
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.
Oof. Yes, not sure what I was thinking here.
@@ -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) |
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.
"
Signed-off-by: Jason C. Leach <[email protected]>
|
If there ends up being any issue remaining for this we may just have to add an |
Summary of Changes
This pull request fixes a bug that occurred when declining a proof request from a notification. If the contact associated with that proof request had their connection deleted, the app would throw a visible error. This happened because the app tried to send a problem report related to the declined proof, but sending a problem report requires an active connection, which no longer existed. This change prevents that error from occurring.
Screenshots, videos, or gifs
n/a
Breaking change guide
n/a
Related Issues
n/a
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.
Signed-off-by
line (we use the DCO GitHub app to enforce this)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 🤓