Skip to content

sync: catch up with forked-from/main (4 commits) - #115

Merged
WarlaxZ merged 6 commits into
mainfrom
sync-forked-from
Sep 17, 2026
Merged

WarlaxZ merged 6 commits into
mainfrom
sync-forked-from

Conversation

@WarlaxZ

@WarlaxZ WarlaxZ commented Sep 17, 2026

Copy link
Copy Markdown
Owner

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:

  • 9ea8199 feat(serve): per-torrent seed time over the API
  • 353c332 fix(download): disable uTP to prevent ENOBUFS socket exhaustion crashes
  • cd230f1 fix(download): restore uTP by default, add TORLINK_NO_UTP opt-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)
  • 0eef299 feat: generate playlists for torrent media folders

All 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.ts also needed the seed reaper switched to always-on (upstream's change — inert without a --seed-time or 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.
  • Extended src/web/wire.ts's StatusDownload/StatusSeed with seedTimeMs/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.
  • Fixed two test fixtures (serve.test.ts, testHarness.ts) whose fake queues didn't implement getHistory(), now that the seed reaper always calls it.

Test plan

  • npm run typecheck — clean
  • npm test — 3407/3407 passing
  • npm run lint — clean on every file this PR touches (repo has one pre-existing react-hooks/exhaustive-deps warning in App.tsx, documented in CLAUDE.md as known/left alone)
  • npm run build — succeeds
  • npm 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

ralyodio and others added 6 commits September 6, 2026 11:14
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.
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
@WarlaxZ
WarlaxZ merged commit f4afdcb into main Sep 17, 2026
6 checks passed
@WarlaxZ
WarlaxZ deleted the sync-forked-from branch September 17, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants