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

Handle no lens results #825

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Handle no lens results #825

merged 2 commits into from
Feb 26, 2024

Conversation

IanWoodard
Copy link
Collaborator

Adding logic to handle and return early the case where there are no lens results when fetching a list of borrower nfts.

Copy link

sentry-io bot commented Feb 24, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: earn/src/data/BorrowerNft.ts

Function Unhandled Issue
fetchListOfBorrowerNfts TypeError: Cannot read properties of undefined (reading 'callsReturnContext') fetchListOfB...
Event Count: 12 Affected Users: 0

Did you find this useful? React with a 👍 or 👎

Copy link

netlify bot commented Feb 24, 2024

Deploy Preview for aloe-earn ready!

Name Link
🔨 Latest commit d5747eb
🔍 Latest deploy log https://app.netlify.com/sites/aloe-earn/deploys/65dc200565ddd4000828eeb5
😎 Deploy Preview https://deploy-preview-825--aloe-earn.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 24, 2024

Deploy Preview for aloe-prime canceled.

Name Link
🔨 Latest commit d5747eb
🔍 Latest deploy log https://app.netlify.com/sites/aloe-prime/deploys/65dc2005b1b2010008d6c08c

Copy link

netlify bot commented Feb 24, 2024

Deploy Preview for aloe-blend-staging canceled.

Name Link
🔨 Latest commit d5747eb
🔍 Latest deploy log https://app.netlify.com/sites/aloe-blend-staging/deploys/65dc20053565c90008ff1074

Copy link
Member

@haydenshively haydenshively left a comment

Choose a reason for hiding this comment

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

We should investigate why the lens call is failing. That shouldn't happen.

@IanWoodard
Copy link
Collaborator Author

We should investigate why the lens call is failing. That shouldn't happen.

While I agree, it is failing, so we should have logic to handle such a case.

@haydenshively
Copy link
Member

Turns out this happens because the multicall context has zero calls. To fix, we should change the enclosing if statement to look like this:

  // Fetch borrowers' in-use status and Uniswap pool, which we'll need for filtering
  if (
    (filterParams?.includeFreshBorrowers || Boolean(filterParams?.validUniswapPool)) &&
    borrowerManagerSets.size > 0
  )

(testing that the set is non-empty is the key)

@haydenshively haydenshively merged commit 4f51d84 into master Feb 26, 2024
18 checks passed
@haydenshively haydenshively deleted the iw/no-lens-results branch February 26, 2024 05:28
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.

2 participants