Skip to content

Remove axios dep#466

Open
KoblerS wants to merge 9 commits into
mainfrom
remove-axios-dep
Open

Remove axios dep#466
KoblerS wants to merge 9 commits into
mainfrom
remove-axios-dep

Conversation

@KoblerS

@KoblerS KoblerS commented Jun 15, 2026

Copy link
Copy Markdown
Member

Remove axios Dependency in Favor of Built-in fetch API

Chore

♻️ Refactor: Replaced the axios external dependency with Node.js built-in fetch and https APIs across the codebase, reducing the dependency footprint.

Changes

Two internal helper functions were introduced to replace axios behavior:

  • _fetch(url, options) — wraps the global fetch API with JSON parsing and error handling.
  • _fetchWithAgent(url, options) — uses Node.js https.request for requests requiring a custom TLS agent (e.g., MTLS flows).
  • package.json: Removed axios from the dependencies list.
  • lib/helper.js: Replaced all axios calls (GET, POST with client credentials, POST with MTLS) with _fetch and _fetchWithAgent. Updated response data access from response.data.* to direct response properties.
  • lib/mtx/server.js: Replaced all axios calls (GET, POST, DELETE) in service manager operations with _fetch and _fetchWithAgent. Updated header access to use headers.get("location") (Fetch API Headers object). Removed the axios import.
  • tests/unit/unitTests.test.js: Removed axios mock and replaced all axios.get/axios.post mock implementations with global.fetch mock chains. Updated the global.fetch default mock to include ok: true for proper response simulation.
  • CHANGELOG.md: Added changelog entry noting the replacement of axios with the built-in fetch API.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.22.9

  • LLM: anthropic--claude-4.6-sonnet
  • Summary Prompt: Default Prompt
  • File Content Strategy: Full file content
  • Correlation ID: d2199f26-87b9-414b-a48f-468a1180a244
  • Output Template: Default Template
  • Event Trigger: pull_request.opened

@KoblerS KoblerS requested a review from a team as a code owner June 15, 2026 08:39

@hyperspace-insights hyperspace-insights Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread lib/helper.js
Comment thread lib/mtx/server.js
Comment thread lib/mtx/server.js
Comment thread lib/helper.js
Comment thread lib/helper.js
@KoblerS KoblerS force-pushed the remove-axios-dep branch from 0339ceb to daf3764 Compare June 18, 2026 07:36
@KoblerS KoblerS mentioned this pull request Jun 22, 2026
1 task
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.

1 participant