Remove axios dep#466
Open
KoblerS wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
The PR successfully removes the axios dependency and replaces it with the built-in fetch API, but introduces several correctness issues: OAuth credentials are sent as URL query parameters instead of in the POST body (a spec violation that can also leak secrets into access logs), the response body is consumed before the status check (making error body capture unreliable), and _pollUntilDone can silently return undefined on timeout/failure causing a downstream null-dereference. Additionally, _fetch/_fetchWithAgent are copy-pasted into two files rather than shared, creating a maintenance burden.
PR Bot Information
Version: 1.22.9
- Event Trigger:
pull_request.opened - File Content Strategy: Full file content
- Correlation ID:
d2199f26-87b9-414b-a48f-468a1180a244 - LLM:
anthropic--claude-4.6-sonnet
…extraction on error
…extraction on error
0339ceb to
daf3764
Compare
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.
Remove
axiosDependency in Favor of Built-infetchAPIChore
♻️ Refactor: Replaced the
axiosexternal dependency with Node.js built-infetchandhttpsAPIs across the codebase, reducing the dependency footprint.Changes
Two internal helper functions were introduced to replace
axiosbehavior:_fetch(url, options)— wraps the globalfetchAPI with JSON parsing and error handling._fetchWithAgent(url, options)— uses Node.jshttps.requestfor requests requiring a custom TLS agent (e.g., MTLS flows).package.json: Removedaxiosfrom thedependencieslist.lib/helper.js: Replaced allaxioscalls (GET, POST with client credentials, POST with MTLS) with_fetchand_fetchWithAgent. Updated response data access fromresponse.data.*to direct response properties.lib/mtx/server.js: Replaced allaxioscalls (GET, POST, DELETE) in service manager operations with_fetchand_fetchWithAgent. Updated header access to useheaders.get("location")(Fetch APIHeadersobject). Removed theaxiosimport.tests/unit/unitTests.test.js: Removedaxiosmock and replaced allaxios.get/axios.postmock implementations withglobal.fetchmock chains. Updated theglobal.fetchdefault mock to includeok: truefor proper response simulation.CHANGELOG.md: Added changelog entry noting the replacement ofaxioswith the built-infetchAPI.PR Bot Information
Version:
1.22.9anthropic--claude-4.6-sonnetd2199f26-87b9-414b-a48f-468a1180a244pull_request.opened