mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-10-18 07:33:01 +00:00
Two problems Codex found in the first push. "SOCKS connection error" is not a circuit failure. arti-build logs that wrapper for every error out of handle_socks_connection, including local protocol faults raised before a circuit is attempted — "Invalid SOCKS handshake", "Unsupported SOCKS version", "Unsupported SOCKS command". Anything on the device that speaks SOCKS badly to the local port would have read as a dead Tor. Drop it. "Failed to connect through Tor" is logged only on client.connect() failure, and "Failed to obtain exit circuit" is arti's own detail for that error, which is what #610 shows — so the reported lines are still matched. The restart path cancels itself. restartArti stops Arti first, and stopArtiInternal cancels retryJob and inactivityJob. Both existing recovery paths call restartArti from inside one of those jobs, so the coroutine is cancelled between the stop and the start and Arti never comes back. That is already true on main for the start-failure and bootstrap-inactivity paths; routing a post-bootstrap outage into it would have turned a wrong indicator into a stopped Tor, which is worse. Run restarts from a separate restartJob that the stop path leaves alone, and cancel it explicitly when the user turns Tor off so a pending recovery cannot resurrect it.