Skip to content

GPHDRUI-427 Upgrade axios from 0.x to 1.18.1 - #164

Merged
thomashilz merged 1 commit into
InterNetX:masterfrom
thomashilz:GPHDRUI-427
Jul 23, 2026
Merged

GPHDRUI-427 Upgrade axios from 0.x to 1.18.1#164
thomashilz merged 1 commit into
InterNetX:masterfrom
thomashilz:GPHDRUI-427

Conversation

@thomashilz

Copy link
Copy Markdown
Collaborator

Bump axios from ^0.30.0 to ^1.18.1 (major upgrade) and review the codebase for breaking changes.

Dependencies:

  • axios: ^0.30.0 -> ^1.18.1
  • axios-mock-adapter: ^1.17.0 -> ^1.22.0 (axios 1.x compatibility)
  • update yarn.lock accordingly

Breaking-change fixes:

  • ContactDocumentService.upload(): drop the manual "Content-Type: multipart/form-data" header. axios 1.x sets the multipart Content-Type incl. boundary automatically for FormData. However, the DomainRobotService constructor installs a global "application/json" default (axios.defaults.headers.common) that would otherwise win and break the multipart request, so clear the Content-Type per request (set to null) to let axios auto-detect it. This was caught by the new HTTP integration test - the mock-adapter suite could not surface it.

Bug fixes in the previously unreachable ContactDocumentService:

  • fix broken module export (Contact -> ContactDocumentService)
  • remove reference to an undefined axios variable (obsolete after the Content-Type change)
  • wire the service into Domainrobot via a new contactDocument() factory so it is reachable through the public API

Tests:

  • add unit/mock tests for ContactDocumentService (upload with/without keys, info, delete)
  • add real HTTP integration tests (no axios-mock-adapter) that validate axios 1.x behaviour the mock suite cannot reach:
    • ContactDocument upload: genuine multipart/form-data body with boundary
    • DomainRobotService: basic auth + context header on the wire, JSON response parsing, response headers via AxiosHeaders, 4xx -> DomainRobotException mapping, connection errors without a response
    • DomainService: PUT with verb-suffixed path + JSON body, GET with dotted domain name, keys[] query string kept intact on the wire (params serialization change does not affect this SDK), body-less POST
  • add "test:integration" npm script (runs tests/Integration/** separately from the mock suite so the global mock adapter does not intercept real requests)

Unaffected by the upgrade (verified): basic auth config, global default headers, request/response flow, error handling via error.response, and parameter serialization (URLs are built manually, params is not used).

Bump axios from ^0.30.0 to ^1.18.1 (major upgrade) and review the
codebase for breaking changes.

Dependencies:
- axios: ^0.30.0 -> ^1.18.1
- axios-mock-adapter: ^1.17.0 -> ^1.22.0 (axios 1.x compatibility)
- update yarn.lock accordingly

Breaking-change fixes:
- ContactDocumentService.upload(): drop the manual
  "Content-Type: multipart/form-data" header. axios 1.x sets the
  multipart Content-Type incl. boundary automatically for FormData.
  However, the DomainRobotService constructor installs a global
  "application/json" default (axios.defaults.headers.common) that would
  otherwise win and break the multipart request, so clear the
  Content-Type per request (set to null) to let axios auto-detect it.
  This was caught by the new HTTP integration test - the mock-adapter
  suite could not surface it.

Bug fixes in the previously unreachable ContactDocumentService:
- fix broken module export (Contact -> ContactDocumentService)
- remove reference to an undefined `axios` variable (obsolete after the
  Content-Type change)
- wire the service into Domainrobot via a new contactDocument() factory
  so it is reachable through the public API

Tests:
- add unit/mock tests for ContactDocumentService (upload with/without
  keys, info, delete)
- add real HTTP integration tests (no axios-mock-adapter) that validate
  axios 1.x behaviour the mock suite cannot reach:
  - ContactDocument upload: genuine multipart/form-data body with boundary
  - DomainRobotService: basic auth + context header on the wire, JSON
    response parsing, response headers via AxiosHeaders, 4xx ->
    DomainRobotException mapping, connection errors without a response
  - DomainService: PUT with verb-suffixed path + JSON body, GET with
    dotted domain name, keys[] query string kept intact on the wire
    (params serialization change does not affect this SDK), body-less POST
- add "test:integration" npm script (runs tests/Integration/** separately
  from the mock suite so the global mock adapter does not intercept real
  requests)

Unaffected by the upgrade (verified): basic auth config, global default
headers, request/response flow, error handling via error.response, and
parameter serialization (URLs are built manually, `params` is not used).
@thomashilz
thomashilz merged commit 654baca into InterNetX:master Jul 23, 2026
1 check failed
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