gendesign/tradein-mvp/browser
Light1YT 8eec6a752c
All checks were successful
CI / changes (pull_request) Successful in 7s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
feat(tradein-browser): additive POST /fetch-json + BrowserFetcher.fetch_json (#915 Stage 2)
Add an in-page fetch() path so backend code can run a same-origin fetch from
inside the warm camoufox page (real fingerprint + context cookies + per-provider
proxy) and get back {status, body}. Purely additive: /fetch, _fetch_once,
_do_fetch, fetch_handler and BrowserFetcher.fetch are untouched. Nothing in the
prod flow calls it yet — a later PR wires avito IMV to it.

Sidecar: _fetch_json_once navigates to origin (anchor page, short 500ms settle
instead of full BROWSER_WAIT_MS), runs fetch via page.evaluate, mirrors the
_fetch_once page lifecycle + recycle/relaunch. _do_fetch_json mirrors _do_fetch
crash-retry. fetch_json_handler mirrors fetch_handler (400/503/500 handling).

Client: BrowserFetcher.fetch_json posts to /fetch-json with the same
single-retry-on-HTTPError/TransportError pattern as fetch.

Tests: browser/test_server_fetch_json.py (handler happy path, origin navigation,
POST payload passthrough, 400 missing url, 400 bad json, 503 unavailable, 500 on
evaluate error) and backend fetch_json client tests (payload, defaults, retry,
raise-after-two-errors).

Refs #915

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:25:06 +05:00
..
Dockerfile fix(browser): pageError.location needs valid defaults, not just optional chaining (#918 follow-up) (#927) 2026-05-31 20:15:39 +00:00
server.py feat(tradein-browser): additive POST /fetch-json + BrowserFetcher.fetch_json (#915 Stage 2) 2026-06-26 14:25:06 +05:00
test_server.py feat(browser): block font/media + per-provider page pacing — снизить proxy fan-out (#1812) 2026-06-19 21:28:09 +03:00
test_server_fetch_json.py feat(tradein-browser): additive POST /fetch-json + BrowserFetcher.fetch_json (#915 Stage 2) 2026-06-26 14:25:06 +05:00
test_server_pacing.py feat(scrapers): live pacing-регулятор (GET/PUT /scraper/pacing) + data-quality coverage endpoint 2026-06-20 12:47:03 +03:00
test_server_resource_block.py feat(browser): block font/media + per-provider page pacing — снизить proxy fan-out (#1812) 2026-06-19 21:28:09 +03:00
test_server_smoke.py feat(browser): per-provider concurrency — параллель между поставщиками, ≤1 коннект на поставщика (#1793) 2026-06-19 18:52:55 +03:00