-
Notifications
You must be signed in to change notification settings - Fork 21
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: filter out expired ENS handles from results #150
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #150 +/- ##
==========================================
+ Coverage 63.49% 63.58% +0.09%
==========================================
Files 24 24
Lines 1145 1148 +3
Branches 132 132
==========================================
+ Hits 727 730 +3
Misses 414 414
Partials 4 4 ☔ View full report in Codecov by Sentry. |
domains(where: {name_in: ["${normalizedHandles.join('","')}"]}) { | ||
domains(where: { | ||
name_in: ["${normalizedHandles.join('","')}"], | ||
expiryDate_gt: "${Math.floor(Date.now() / 1e3)}"} |
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.
expiryDate
is null if name is a subdomain example 1.snapspace.eth
should be fine.?
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.
Will add some tests for that
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.
mhhh... subdomain does not return any address, even without the expiryDate filter.
Should we just convert all subdomains to domains, and use the domain's resolved address ? (and map it back to the subdomain)
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.
mmm getting complicated 😢 may be better to return the domain if doesn't have expiryDate for now
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.
Issue is that subdomain does not return any result, even on master.
🧿 Current issues / What's wrong ?
When resolving ENS address from ENS's subgraph, we're returning all names associated to the address, without taking into account expiration date.
💊 Fixes / Solution
Fix #147
We should filter out expired domains from the results.
🚧 Changes
🛠️ Tests
Test with the following query
This domain is expired (https://app.ens.domains/49415.eth)
Before fix, it returns
{"jsonrpc":"2.0","result":{"49415.eth":"0xD3F0DC8F0aE3b5cd6FCB4a7e5dBC3154554d17F3"},"id":null}
After fix, it returns
{"jsonrpc":"2.0","result":{},"id":null}