Pit toggle: ride out the stale-helper window after launch instead of failing - #103
Merged
Merged
Conversation
…failing
First click on bonita after tron upgrade: 'The pit resolver couldn't start', and the helper log showed the 3.3.0 helper listening with no pit: line at all. The request had reached the OLD 3.2.8 helper, which the launcher replaces in the background a moment after launch; it answered 404 {error:not-found} and the sidebar showed the generic message.
The background now retries /pit/start every 2s for up to 5 attempts while the answer is a 404 or nobody is listening, then reports helper-stale; the sidebar names that case (try again, or quit and relaunch) and shows the error code on the generic fallback. The helper logs unknown routes so a stale-version hit leaves a trace next time. Helper version 3.3.1.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ThreatCrush Security Scan53 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 32 | LOW: 20
…and 3 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First click on 🤘 Pit on bonita right after
tron upgradefailed with the generic "The pit resolver couldn't start", and~/.tronbrowser/tor-helper.logshowed the 3.3.0 helper listening with nopit:line at all. The request never reached the new helper.Why
The launcher replaces an out-of-date helper in the background a moment after launch (kill, settle 1s, exec). A click inside that window reaches the OLD 3.2.8 helper, which has no
/pit/*routes and answers404 {"error":"not-found"}without logging it. The sidebar mapped that to the generic message, so nothing pointed at the real cause.Fix
background.js:/pit/startis retried every 2 s, up to 5 attempts, while the answer is a 404 or nobody is listening; if it never catches up the error ishelper-stale. A pit-capable helper's own error (port busy) still returns at once.sidepanel.js: names the stale-helper case (try again, or quit TronBrowser completely and relaunch) and shows the error code on the generic fallback instead of hiding it.tron-tor-helper: logs unknown routes, so a stale-version hit leaves a trace next time. Version 3.3.1, matched in the launcher.Verified
pnpm lintclean, extension tests 30/30, helper compiles, launchersh -nok. Not reproduced on bonita (no SSH from here); the diagnosis is from the log's absence of apit:line and the launcher's replacement sequence.🤖 Generated with Claude Code