Skip to content

fix(http): restore query responses and normalize options - #2656

Open
minjungsung wants to merge 1 commit into
winstonjs:masterfrom
minjungsung:fix/http-query-response
Open

minjungsung wants to merge 1 commit into
winstonjs:masterfrom
minjungsung:fix/http-query-response

Conversation

@minjungsung

Copy link
Copy Markdown

HTTP transport queries currently throw TypeError: this.normalizeQuery is not a function. They also discard the HTTP response body, preventing query results from reaching the callback. The documented log-query API therefore does not work in Winston 3.19.0.

Normalize query options locally without mutating the caller's object, retain the existing File transport's defaults, and collect query response chunks before decoding UTF-8 and parsing JSON. Send queries directly even when log batching is enabled. A private Symbol distinguishes query requests without colliding with log metadata; regular logging responses still drain without buffering.

Add four local HTTP-server regressions covering results with batching enabled/disabled, a split multibyte response, unchanged caller options, and malformed/empty responses.

Validation:

  • All four regressions fail on the original implementation.
  • Full Jest suite: 241 passed, 3 existing TODOs, 23 suites passed. Jest retained open handles after reporting completion; the focused query suite exits cleanly with open-handle detection enabled.
  • ESLint and the Babel distribution build pass.

Related history: #787 fixed response collection in the former implementation; this restores the behavior in the current 3.x transport.

AI assistance: implementation, tests, and this description were prepared with Codex.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 00:24

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants