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

Conversation

jleach
Copy link
Contributor

@jleach jleach commented Feb 7, 2025

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.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • If applicable, screenshots, gifs, or video are included for UI changes
  • If applicable, breaking changes are described above along with how to address them
  • Updated documentation as needed for changed code and new or modified features
  • 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 checks have passed

Signed-off-by: Jason C. Leach <[email protected]>
Signed-off-by: Jason C. Leach <[email protected]>
@jleach jleach marked this pull request as ready for review February 7, 2025 23:13
@jleach jleach requested a review from a team as a code owner February 7, 2025 23:13
@@ -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.

@@ -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.

"

Signed-off-by: Jason C. Leach <[email protected]>
Copy link

sonarqubecloud bot commented Feb 8, 2025

@jleach jleach requested a review from bryce-mcmath February 8, 2025 00:22
@al-rosenthal al-rosenthal merged commit a4b9e95 into openwallet-foundation:main Feb 8, 2025
8 checks passed
@bryce-mcmath
Copy link
Contributor

If there ends up being any issue remaining for this we may just have to add an .assertReady() check on the connection as well.

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