Skip to content

v0.4.5

@Averyy Averyy tagged this 31 Jul 18:13
Three paths in the bootstrap diagnostics reported state that did not match
what happened, and one of them changed behavior.

A transport exception in the async bootstrap recorded `transport` and
returned False without the rotation check every other leg makes. When a
concurrent rotation retired the client mid-leg, the exception it raised said
nothing about Reddit, but the outer loop read it as a real failure: it
skipped the cheap retry on the replacement client and spent the browser
fallback instead. The except path now returns None on a changed client, like
the rest of the function.

`_record_reddit_bootstrap_attempt` ran before `_reddit_subrequest_kwargs`,
which raises WaferTimeout when the budget is already spent. That counted an
attempt which never reached the network, and since the WaferTimeout re-raise
records no outcome, it left the previous `last_outcome` sitting beside a
bumped count -the exact invariant the counters were added to establish. The
kwargs are now built first, inside the same try.

The browser recovery was counted only after the solver returned, so a solver
that raised left `browser_attempts` and `last_browser_outcome` describing
some earlier recovery. `_record_reddit_browser_attempt` now counts it before
the solve and writes a provisional `interrupted` outcome; every normal return
overwrites it, so only a raise leaves it behind. `_record_reddit_browser_
outcome` no longer counts, which removed its `attempted=` parameter from all
three call sites.

The duplicate no-budget decision between `_try_reddit_browser_bootstrap` and
`_try_browser_solve` is left in place -both use the same helper and the same
predicate -but the comment at each site now says they must stay in step.

Five of the six new tests fail against the unfixed source; the sixth guards
the provisional outcome against leaking into a successful recovery.
Live-verified on a cold anonymous session: gate detected, bootstrap
established, 200 with inline_solves=1.
Assets 2
Loading