0.35.9: the pin moves to invisible-core 47.40.0 (#349)

A connection releases each pipe end once: closing a browser twice no longer
closes the pipe of another browser in the same process.
This commit is contained in:
Federico Elia authored and GitHub committed 2026-10-14 18:09:56 -07:00
1 parent c1835182ed
commit 48770e590e
3 files changed
+66 -2

No files matched your search

+14
View File
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
## [0.35.9] - 2026-10-15
The pin moves to invisible-core 47.40.0, on the same firefox-47 engine.
### Fixed
- **Closing a browser no longer closes the pipe of another browser in the
same process.** The driver closes a browser's pipe from `Browser.close` and
again when the session shuts down, and each call closed the pipe's
descriptor numbers. A released number goes to the next pipe the process
opens, so when one process drove several sessions the second call closed
another browser's pipe: its launch died with `EISDIR`, or it stopped
answering. The connection now releases each end once and never touches
the number again.
## [0.35.8] - 2026-10-14
The pin moves to invisible-core 47.39.0, which seals the firefox-47 engine.
+2 -2
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "invisible_playwright"
version = "0.35.8"
version = "0.35.9"
description = "Playwright wrapper for a patched Firefox with deterministic stealth profile."
readme = "README.md"
requires-python = ">=3.11"
@@ -69,7 +69,7 @@ dependencies = [
# metadata; nothing in src/ hardcodes a second copy (tests/test_core_pin.py
# fails if one appears). What stays invisible to install-time machinery is the
# --no-deps / lockfile residue, and _pin.py is the only layer that sees it.
"invisible_core==47.39.0",
"invisible_core==47.40.0",
# ⛔ playwright is NO LONGER a dependency: since the full fork, the Python
# client lives in src/invisible_playwright/_pw/ and the Node driver in
# src/invisible_playwright/_driver/. Reintroducing it would not visibly
@@ -0,0 +1,50 @@
"""A browser closed twice leaves the other browsers of the process alone.
The known-bad input, reported 2026-10-15: the driver closes a browser's pipe
from `Browser.close` and again from the session's shutdown hook. Through
invisible-core 47.39.0 each call closed the pipe's descriptor NUMBERS, and a
released number goes to the next pipe the process opens, so when one process
drives several sessions the second call closed another browser's pipe: its
launch died with EISDIR, or its next command found the pipe gone.
Two sessions in one event loop make the order deterministic: the first closes
its browser (its numbers are released), the second launches (and is given
them), the first shuts down (the second close), and the second must still
drive its page. Measured on Windows against 47.39.0 and firefox-47: the run
does not fail, it HANGS - the second close lands on a number the other
browser's output reader is blocked on, and Windows holds that close until the
read returns - so what turns it red is the suite's per-test timeout
(`run_e2e.py`). Against 47.40.0 it passes in under 20 s.
"""
from __future__ import annotations
import asyncio
import pytest
pytestmark = pytest.mark.e2e
def test_a_session_shutting_down_does_not_close_another_sessions_pipe(firefox_binary):
from invisible_playwright.async_api import InvisiblePlaywright
async def run():
first = InvisiblePlaywright(seed=7001, binary_path=firefox_binary, headless=True)
browser = await first.__aenter__()
try:
await browser.close()
async with InvisiblePlaywright(seed=7002, binary_path=firefox_binary,
headless=True) as other:
page = await other.new_page()
await page.set_content("<p>still here</p>")
await first.__aexit__(None, None, None)
first = None
assert await page.text_content("p") == "still here"
page = await other.new_page()
await page.set_content("<p>and again</p>")
assert await page.text_content("p") == "and again"
finally:
if first is not None:
await first.__aexit__(None, None, None)
asyncio.run(asyncio.wait_for(run(), 180))