fix(tradein-browser): in-page fetch retry + settle tuning for /fetch-json (#1917) #1938

Merged
bot-backend merged 1 commit from fix/1917-fetch-json-network-retry into main 2026-06-27 00:31:20 +00:00

1 commit

Author SHA1 Message Date
2687f75b92 fix(tradein-browser): in-page fetch retry + configurable settle for /fetch-json (#1917)
All checks were successful
CI / changes (pull_request) Successful in 6s
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
First XHR after goto(origin) intermittently hit "NetworkError when
attempting to fetch resource" (page net stack/anti-bot not ready),
healed only by the outer re-navigation retry (~30-45s/house in the
house_imv_backfill, #562).

_fetch_json_once now:
- settles FETCH_JSON_SETTLE_MS (default 1200, was hardcoded 500) — fewer
  first-fails;
- wraps the in-page fetch() in a JS retry loop (FETCH_JSON_INPAGE_RETRIES
  default 1, FETCH_JSON_RETRY_DELAY_MS default 800) that retries ONLY on
  network throw, never on HTTP status (4xx/5xx short-circuit, caller
  decides). An in-page retry costs ~retryDelayMs vs the ~30-45s outer
  re-navigation. Last error re-thrown — outer crash-retry contract intact.

/fetch (SERP) path untouched. +2 tests (settle ms, retry params).

Refs #1917, #562
2026-06-27 05:30:16 +05:00