Skip to content

Release Notes: v0.4.2

Release Date: 2026-10-14

Overview

Traffic2OpenAPI v0.4.2 fixes bugs in the Playwright browser adapters. The writers in the TypeScript adapter could hang or produce truncated gzip output, and the Python adapter's path-pattern exclusion did not match patterns that are not anchored at the start of the path.

The Python adapter's top-level imports (from traffic2openapi_playwright import PlaywrightCapture) failed from a checkout because the package __init__.py had never been committed. Responses delivered after close() also failed with a closed-writer error.

The Go packages are unchanged from v0.4.1. Users of HAR conversion, inference, and OpenAPI generation are unaffected. If you capture traffic with the TypeScript or Python Playwright adapter, upgrade to pick up these fixes.

Highlights

  • TypeScript adapter writers are reliable: flush() no longer hangs and gzip output is no longer truncated
  • Python package imports correctly: __init__.py is now tracked, so top-level imports work
  • Python path-pattern exclusion works: patterns such as \.js$ now match as documented

Fixed

  • TypeScript adapter: NDJSONWriter.flush() waited for a drain event that does not fire when the stream buffer is below its high-water mark, so it never resolved. It now resolves once buffered records are written.
  • TypeScript adapter: GzipNDJSONWriter.close() ended the file stream before the compressed data had been piped to it, truncating the file. An empty capture produced a zero-byte file instead of a valid gzip stream. It now resolves after the file stream has closed.
  • Python adapter: exclude_path_patterns matched with re.match, which anchors at the start of the path, so patterns such as \.js$ never matched. It now uses re.search, consistent with the TypeScript adapter's excludePathPatterns.

  • Python adapter: the package __init__.py was never committed because it matched a .gitignore rule, so top-level imports such as from traffic2openapi_playwright import PlaywrightCapture failed from a checkout. It is now tracked.

  • Python adapter: responses delivered after close() are ignored instead of failing with a closed-writer error. Playwright delivers events while your code is inside an API call, so wait for in-flight responses (for example page.wait_for_load_state("networkidle")) before closing the capture.

Documentation

  • Playwright adapter docs and the integration test wait for network idle before closing the capture

Tests

  • Correct the Python adapter test mock so Request.method is a property, matching Playwright's API

Build

  • Python adapter: pin the ruff rule set (E, F, I, W; line length 100) so lint results do not change when ruff changes its defaults, and clean up imports