Skip to content

Architectural Stability, Cross Platform Reliability & Better DX

Latest

Choose a tag to compare

@laphilosophia laphilosophia released this 19 Feb 14:48

This release focuses on architectural stability, cross-platform reliability, and better developer experience through comprehensive examples.

Structural Graceful Shutdown

API Tape now implements a more robust graceful shutdown mechanism using stdin EOF detection. This specifically addresses a long-standing issue on Windows where standard signals like SIGINT or SIGBREAK would forcefully terminate the process (TerminateProcess), preventing the emission of final runtime metrics.

By shifting to stdin closure for non-TTY processes, API Tape ensures that stats are always flushed correctly in CI/CD environments and automated test suites.

Comprehensive Examples Suite

We've added a new examples/ directory featuring 4 practical use cases to get you started:

  • 01 Basic Recording: The fundamental record-and-replay workflow.
  • 02 Hybrid Fallback: Demonstrating proxy-fallback logic for missing tapes.
  • 03 Data Redaction: Securing sensitive data by masking headers and JSON body fields.
  • 04 Body-Aware Matching: Handling complex POST/PUT requests with varying payloads.

Each example comes with cross-platform scripts (run.sh for Unix and run.ps1 for Windows) for one-click testing.

Detailed Changelog

Added

  • Graceful Shutdown: stdin EOF listener for non-interactive environments ensures consistent lifecycle management.
  • Examples: Multi-platform use-case scripts and documentation.
  • Test Stability: Refined stopProcess test utility to support natural execution termination.

Fixed

  • Windows Stats: Fixed a bug where FINAL_STATS were skipped on Windows during shutdown.
  • CI Reliability: Improved test runner coordination to prevent race conditions during proxy termination.