fix(lifi): remove dead getAllChains() helper that raced config init - #10
Open
ifeanyikizito393 wants to merge 1 commit into
Open
fix(lifi): remove dead getAllChains() helper that raced config init#10ifeanyikizito393 wants to merge 1 commit into
ifeanyikizito393 wants to merge 1 commit into
Conversation
getAllChains() called ensureConfig() without awaiting it, creating a race condition where getChains() could run before LI.FI config was initialized. It also dumped the full chain list to the server console and was never referenced anywhere in the codebase. Remove the dead export entirely; the LI.FI config is initialized via ensureConfig() in fetchSupportedChains() and getBridgeQuote().
|
@ifeanyikizito393 is attempting to deploy a commit to the saber1y's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@Saber1Y Hi! This PR is open and ready for review — happy to address any feedback. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes the buggy
getAllChains()helper insrc/lib/lifi.ts. The function calledensureConfig()without awaiting it, sogetChains()could run before the LI.FI config (and chain set) was initialized — a potential race condition. It also dumped the entire chain list to the server console viaconsole.log(chains)and was never referenced anywhere in the codebase (dead code).Per the issue's suggested fix, the function is removed entirely. The LI.FI config is still initialized properly via
await ensureConfig()infetchSupportedChains()andgetBridgeQuote().Related Issue
Closes #7
Changes
getAllChains()fromsrc/lib/lifi.tsensureConfig()race condition.ChainType/getChainsimports remain in use byensureConfig()andfetchSupportedChains().Verification Results
getAllChains()no longer referencesensureConfig()console.log(chains)noise in server logsgetAllChainsreferenced anywhere in codebasemain; none introduced