sync: catch up with forked-from/main (4 commits) - #115
Merged
Merged
Conversation
baairon#185 disabled uTP on every platform to stop ENOBUFS socket exhaustion crashes. That is wider than the failure it fixes: every major BitTorrent client ships with TCP and uTP both enabled, and turning uTP off also stops torlink accepting inbound uTP and narrows the NAT port mapping to TCP only. The exhaustion is a webtorrent dial-path defect rather than a cost of uTP. utp-native multiplexes fine, and webtorrent already holds a bound uTP socket on the TCP port, but lib/torrent.js dials through the module-level UTP.connect, which allocates a fresh UDP socket per outgoing peer. Sockets then scale with peer count until the ephemeral port pool or buffer space runs out, and a failed bind is re-emitted on an emitter nothing listens to, so it arrives as an uncaughtException. uTP is on again by default, as it was before baairon#185. TORLINK_NO_UTP disables it for anyone hitting the crash before that dial path is fixed upstream.
Co-authored-by: bairon.dev <hi@bairon.dev>
Brings in upstream: per-torrent seed time over the control API, the uTP socket-exhaustion fix and its follow-up restoring uTP by default behind TORLINK_NO_UTP, and .m3u playlist generation for multi-file torrent folders. Resolved conflicts by keeping both sides' additions where they touched the same region (CLI args, runtime/serve options, App.tsx props, QueueItem fields, README sections), and extended src/web/wire.ts's StatusDownload/ StatusSeed with seedTimeMs/seedUntil so the new fields flow through the same type-checked wire contract as everything else in that payload. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0113GE7YUVVDMZFBrrsUL4PK
…calls it runServe now starts the seed reaper unconditionally (it's a no-op without a --seed-time or a per-torrent override), so any fake Runtime.queue used in a test that exercises runServe or statusPayload needs getHistory() too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0113GE7YUVVDMZFBrrsUL4PK
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.
Summary
Merges the 4 commits
forked-from/main(baairon/torlink) has that we don't, so the fork comparison shows caught up instead of behind:9ea8199feat(serve): per-torrent seed time over the API353c332fix(download): disable uTP to prevent ENOBUFS socket exhaustion crashescd230f1fix(download): restore uTP by default, addTORLINK_NO_UTPopt-out (upstream's own follow-up narrowing fix(download): disable uTP to prevent ENOBUFS socket exhaustion crashes baairon/torlink#185 — net effect: uTP stays on by default, with an escape hatch)0eef299feat: generate playlists for torrent media foldersAll four are additive/fixes with no overlap with anything we've built since diverging (checked: no existing uTP handling, and our per-torrent-seed-time vs. m3u-streaming-playlist code are unrelated to what these commits touch) — nothing here moves us backwards.
Conflicts and how they were resolved
7 files conflicted, all because both sides extended the same struct/function independently (our own 398 commits of divergence vs. their 4). Resolved by keeping both sides' additions rather than picking one:
src/cli/args.ts,src/daemon/runtime.ts,src/daemon/serve.ts,src/download/types.ts,src/ui/App.tsx— each had us and upstream add distinct new fields/params to the same interface or function signature; combined them.src/daemon/serve.tsalso needed the seed reaper switched to always-on (upstream's change — inert without a--seed-timeor per-torrent override), while keeping our state-dir-writable check and reccd auto-provisioning that sit right next to it.README.md— combined our new sections (Docker, LAN sharing, posters) with upstream's new seed-time docs.src/web/wire.ts'sStatusDownload/StatusSeedwithseedTimeMs/seedUntil— upstream doesn't have this type-checked wire-contract layer, so their new API fields needed declaring here to flow through it instead of being untyped extras.serve.test.ts,testHarness.ts) whose fake queues didn't implementgetHistory(), now that the seed reaper always calls it.Test plan
npm run typecheck— cleannpm test— 3407/3407 passingnpm run lint— clean on every file this PR touches (repo has one pre-existingreact-hooks/exhaustive-depswarning inApp.tsx, documented inCLAUDE.mdas known/left alone)npm run build— succeedsnpm run previews— ran clean, no drift from this change (reverted an unrelated pre-existing staleness in two preview SVGs it also regenerated)🤖 Generated with Claude Code
https://claude.ai/code/session_0113GE7YUVVDMZFBrrsUL4PK