Skip to content

fix(client): return axios response headers whole - #488

Merged
rodrigojara-cko merged 1 commit into
masterfrom
fix/INT-1866-axios-response-headers
Dec 4, 2026
Merged

rodrigojara-cko merged 1 commit into
masterfrom
fix/INT-1866-axios-response-headers

Conversation

@rodrigojara-cko

@rodrigojara-cko rodrigojara-cko commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With httpClient: 'axios', the cko-request-id, cko-version and etag values in response.headers came back as their first character only (req_abc returned r). The axios path read them with [0], but axios returns header values as strings. The default fetch client was not affected.

Changes

  • src/services/http.js: the axios response reads its headers with getResponseHeaders, the same function as the fetch response; the axios-only reader is removed. Each header is read through headerOf, and the request id through requestIdOf, which the 3xx errors also use: a 3xx whose headers an axios interceptor turned into a plain object now has its request_id in the error body, as with AxiosHeaders.
  • test/http/responseHeaders.js: new tests against a local server for both clients: whole values, the request-id and version fallbacks, an etag without a request id, no headers, headers an axios interceptor turned into a plain object, on a 2xx and on a 3xx.

Design notes: axios response headers are an AxiosHeaders object with get(), as fetch Headers are, so one reader serves both clients. requestIdOf read the 3xx request id with get() only; it now goes through headerOf too, so the request id is read in one place for every response. The SDK uses the default axios instance, so an application response interceptor applies to its calls; one that rebuilds the response can leave the headers as a plain object without get(). headerOf reads those as properties, so such calls keep succeeding as they did before this change. No header value needs indexing: every value the SDK reads is a string with both clients. With axios, Node's HTTP parser joins a repeated cko-request-id or cko-version with , and keeps the first etag; fetch Headers.get() joins every repeated header, etag included. Only set-cookie comes as an array in axios, and the SDK does not read it.

API Reference

None.

Breaking changes

None. With axios, a response without cko-request-id now returns the three keys (empty when the header is absent) instead of an empty object, as the fetch client always has; this keeps the etag that was dropped before.

Tests

  • Existing tests pass (the axios token timeout integration test fails intermittently with write ECANCELED on master as well)
  • Serialization tests cover every new or changed property (no request or response type changed; new response header tests for both clients)
  • README updated if documented usage changed (documented usage unchanged)

Related

None.

@rodrigojara-cko
rodrigojara-cko requested a review from a team December 2, 2026 12:37
@agent-wall-e

agent-wall-e Bot commented Dec 2, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change is a non-destructive bug fix that unifies header reading logic using existing abstractions, removes a faulty axios-specific reader, adds tests, and introduces no new endpoints, persisted data, auth changes, or external integrations.

Operational gates

  • ✅ jira_ticket (INT-1866)
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 2, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — The change is a non-destructive bug fix that unifies header reading logic using existing abstractions, removes a faulty axios-specific reader, adds tests, and introduces no new endpoints, persisted data, auth changes, or external integrations. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e agent-wall-e Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Auto-approved — this PR meets all Low-risk criteria.

All checks passed, no unresolved comments, and the change classification is:

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change only refactors the existing axios header-reading logic to fix a bug (returning full string values instead of first characters) by unifying it with the existing fetch header reader, with no new endpoints, persisted data, auth changes, or external integrations introduced.

wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@rodrigojara-cko
rodrigojara-cko force-pushed the fix/INT-1866-axios-response-headers branch from 5768e53 to cb58441 Compare December 3, 2026 16:05
@agent-wall-e

agent-wall-e Bot commented Dec 3, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change only refactors an existing response-header reading function by unifying two code paths into one, with no new endpoints, persisted data, auth changes, or external integrations introduced.

Operational gates

  • ✅ jira_ticket (INT-1866)
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 3, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — The change only refactors an existing response-header reading function by unifying two code paths into one, with no new endpoints, persisted data, auth changes, or external integrations introduced. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e agent-wall-e Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Auto-approved — this PR meets all Low-risk criteria.

All checks passed, no unresolved comments, and the change classification is:

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change is a non-destructive bug fix that unifies header reading logic between axios and fetch clients using existing abstractions, introduces no new endpoints, persisted data, auth changes, or external integrations.

wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

With the axios client, cko-request-id, cko-version and etag were read with
[0], but axios returns header values as strings, so only their first
character was returned. A response without cko-request-id also returned no
headers at all, so its etag was lost.

The axios response now reads its headers with the same function as fetch,
so both clients return the same values. Headers an application interceptor
turned into a plain object are read as properties, so those calls still
succeed.

The request id of a 3xx error is read the same way, so it is kept
when an interceptor turned the headers into a plain object.
@rodrigojara-cko
rodrigojara-cko force-pushed the fix/INT-1866-axios-response-headers branch from cb58441 to 3eeb820 Compare December 4, 2026 12:49
@agent-wall-e

agent-wall-e Bot commented Dec 4, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change only refactors how existing response headers are read in the axios path, unifying it with the fetch path using an already-existing helper, with no new endpoints, persisted data, auth changes, or external integrations.

Operational gates

  • ✅ jira_ticket (INT-1866)
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 4, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — The change only refactors how existing response headers are read in the axios path, unifying it with the fetch path using an already-existing helper, with no new endpoints, persisted data, auth changes, or external integrations. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@agent-wall-e agent-wall-e Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Auto-approved — this PR meets all Low-risk criteria.

All checks passed, no unresolved comments, and the change classification is:

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:The change only refactors how existing response headers are read (fixing a bug where axios header values were incorrectly indexed with [0]), reuses existing code paths and abstractions, adds no new endpoints or external integrations, and does not persist any new data.

wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@rodrigojara-cko
rodrigojara-cko merged commit 7430e0e into master Dec 4, 2026
6 checks passed
@rodrigojara-cko
rodrigojara-cko deleted the fix/INT-1866-axios-response-headers branch December 4, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants