mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 01:56:16 -08:00
Closes #1356. Discovery wrapped `authenticate()` in a timeout that rejected only the wrapper — the underlying flow kept running, so a late `get_profile` could land after a healthy candidate had already authenticated. `get_profile` is what adopts a token for the MAC portal-side, so the abandoned attempt invalidated the working candidate's token and discovery reported a live portal as refused. `authenticate()` now takes an `AbortSignal` and checks it before every portal call; discovery gives each confirmation its own controller and aborts it when the attempt exceeds its budget. The issue proposed threading the signal through IPC to axios. That does not address this harm: once a request is on the wire the server processes it whether or not the client tears the socket down, so only NOT SENDING the request prevents the adoption — which is what the between-calls check guarantees. Cancellation is therefore cooperative by design. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>