Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Sep 3, 2025

fix: remove ipfs.io fallback in DNSLink resolution

fix: deduplicate concurrent DNSLink lookups for same domain

  • added in-flight request tracking with pendingLookups Map
  • prevents multiple simultaneous API calls for the same FQDN
  • reduces redundant requests from 2-4 down to 1 per domain

closes #1337

- removed hardcoded fallback to https://ipfs.io when offline
- switched from deprecated /api/v0/name/resolve to /api/v0/resolve
- use POST method for RPC API calls (not GET)
- return undefined when offline to avoid caching false negatives
- prevent privacy leak by not sending requests to external services
- added in-flight request tracking with pendingLookups Map
- prevents multiple simultaneous API calls for the same FQDN
- reduces redundant requests from 2-4 down to 1 per domain
- improves performance on initial page load with empty cache
@lidel lidel requested a review from SgtPooki September 3, 2025 02:42
@lidel lidel requested review from a team and whizzzkid as code owners September 3, 2025 02:42
Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

lgtm, but two comments :)

store promise after invocation to prevent race where finally block
could execute before promise is stored in pendingLookups Map

addresses #1339 (comment)
clarifies the three possible return values and their semantics
as requested in review

addresses #1339 (comment)
@lidel lidel merged commit f805293 into main Sep 5, 2025
5 checks passed
@lidel lidel deleted the fix/dnslink-410-gone-issue-1337 branch September 5, 2025 21:32
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.

Companion not working because https://ipfs.io/api/v0/name/resolve/ipfs.io is 410 - Gone

3 participants