Page MenuHomePhabricator

[lib] Add timeout to ENSCache
ClosedPublic

Authored by ashoat on Feb 3 2023, 12:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 2:18 AM
Unknown Object (File)
Fri, Nov 22, 2:18 AM
Unknown Object (File)
Fri, Nov 22, 2:18 AM
Unknown Object (File)
Fri, Nov 22, 2:17 AM
Unknown Object (File)
Oct 22 2024, 3:19 AM
Unknown Object (File)
Oct 22 2024, 3:19 AM
Unknown Object (File)
Oct 22 2024, 3:03 AM
Unknown Object (File)
Oct 21 2024, 3:53 PM
Subscribers

Details

Summary

I noticed that when the Alchemy key is missing, ethers.js won't resolve any promises.

Introducing this timeout makes sure that async functions won't stall indefinitely, and can fall back to using the ETH address if the ENS name fails to resolve.

Depends on D6551

Test Plan

Confirmed timeout works and that async functions resolve within 5s

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul added inline comments.
lib/utils/ens-cache.js
84–87 ↗(On Diff #21933)

Interesting

This revision is now accepted and ready to land.Feb 4 2023, 11:12 AM
This revision was automatically updated to reflect the committed changes.