Page MenuHomePhabricator

[lib] Add timeout to ENSCache
ClosedPublic

Authored by ashoat on Feb 3 2023, 12:33 AM.
Tags
None
Referenced Files
F3493283: D6552.diff
Thu, Dec 19, 2:45 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: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
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul added inline comments.
lib/utils/ens-cache.js
84–87

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.