@torrent-tv/proxy 2.80.8 → 2.80.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +1675 -1658
  2. package/bin/cli.js +606 -596
  3. package/package.json +51 -50
  4. package/services/data-channel-handler.js +2 -4
  5. package/services/encode/CoverageMap.js +428 -401
  6. package/services/encode/EncodePlan.js +0 -3
  7. package/services/encode/EncodeRun.js +14 -0
  8. package/services/encode/SegmentStore.js +718 -669
  9. package/services/hls-session-manager.js +44 -162
  10. package/services/hwaccel.js +2 -2
  11. package/services/memory-report.js +596 -592
  12. package/services/orchestrators/EncodeOrchestrator.js +143 -11
  13. package/services/quality/EncodeCost.js +555 -555
  14. package/test/auto-quality-step.test.js +514 -507
  15. package/test/contention.test.js +1 -1
  16. package/test/coverage-follows-the-disk.test.js +187 -0
  17. package/test/coverage-map.test.js +195 -178
  18. package/test/encode-orchestrator.test.js +1 -2
  19. package/test/encode-plan-viewers.test.js +18 -19
  20. package/test/encode-plan.test.js +3 -4
  21. package/test/held-request-width.test.js +155 -154
  22. package/test/helpers/encode-run.js +136 -128
  23. package/test/orchestrator-wired.test.js +16 -11
  24. package/test/produced-copy-choice.test.js +358 -327
  25. package/test/run-intervals.test.js +100 -100
  26. package/test/segment-serve-wiring.test.js +76 -20
  27. package/test/segment-store.test.js +216 -187
  28. package/test/stale-request-after-seek.test.js +51 -77
  29. package/test/tracks-begin-together.test.js +176 -153
  30. package/test/viewer-outputs.test.js +278 -273
  31. package/test/behind-head-repair.test.js +0 -261
  32. /package/services/{contention.js → encode/contention.js} +0 -0
  33. /package/{test/decode-cost.test.js → test-measured/decode-cost.measured.js} +0 -0
  34. /package/{test/decode-measurement.test.js → test-measured/decode-measurement.measured.js} +0 -0
package/package.json CHANGED
@@ -1,50 +1,51 @@
1
- {
2
- "name": "@torrent-tv/proxy",
3
- "version": "2.80.8",
4
- "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
- "license": "GPL-3.0-or-later",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
- "type": "module",
10
- "engines": {
11
- "node": ">=24 <25"
12
- },
13
- "bin": {
14
- "torrent-tv-proxy": "./bin/cli.js"
15
- },
16
- "scripts": {
17
- "patch": "npm whoami && npm version patch && npm publish && git push --follow-tags",
18
- "minor": "npm whoami && npm version minor && npm publish && git push --follow-tags",
19
- "major": "npm whoami && npm version major && npm publish && git push --follow-tags",
20
- "start": "node ./bin/cli.js",
21
- "dev": "node --inspect=0 --experimental-network-inspection ./bin/cli.js",
22
- "test": "npm run lint && node --test",
23
- "graph": "node scripts/render-run-graph.js",
24
- "lint": "biome lint ."
25
- },
26
- "dependencies": {
27
- "@fastify/cors": "^11.2.0",
28
- "@fastify/helmet": "^13.0.2",
29
- "@fastify/static": "^10.1.2",
30
- "@silentbot1/nat-api": "^0.4.9",
31
- "chalk": "^5.4.1",
32
- "commander": "^12.1.0",
33
- "fastify": "^5.8.5",
34
- "ffmpeg-static": "^5.3.0",
35
- "franc": "^6.2.0",
36
- "get-port": "^7.1.0",
37
- "node-datachannel": "^0.32.0",
38
- "parse-torrent": "^11.0.23",
39
- "uint8-util": "2.2.6",
40
- "webtorrent": "2.8.5",
41
- "werift": "^0.24.2",
42
- "ws": "^8.18.2"
43
- },
44
- "devDependencies": {
45
- "@biomejs/biome": "^2.5.7"
46
- },
47
- "overrides": {
48
- "utp-native": "npm:@torrent-tv/utp-native@2.5.3-ttv.8"
49
- }
50
- }
1
+ {
2
+ "name": "@torrent-tv/proxy",
3
+ "version": "2.80.10",
4
+ "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
+ "license": "GPL-3.0-or-later",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "engines": {
11
+ "node": ">=24 <25"
12
+ },
13
+ "bin": {
14
+ "torrent-tv-proxy": "./bin/cli.js"
15
+ },
16
+ "scripts": {
17
+ "patch": "npm whoami && npm version patch && npm publish && git push --follow-tags",
18
+ "minor": "npm whoami && npm version minor && npm publish && git push --follow-tags",
19
+ "major": "npm whoami && npm version major && npm publish && git push --follow-tags",
20
+ "start": "node ./bin/cli.js",
21
+ "dev": "node --inspect=0 --experimental-network-inspection ./bin/cli.js",
22
+ "test": "npm run lint && node --test && npm run test:measured",
23
+ "graph": "node scripts/render-run-graph.js",
24
+ "lint": "biome lint .",
25
+ "test:measured": "node --test --test-concurrency=1 test-measured/decode-cost.measured.js test-measured/decode-measurement.measured.js"
26
+ },
27
+ "dependencies": {
28
+ "@fastify/cors": "^11.2.0",
29
+ "@fastify/helmet": "^13.0.2",
30
+ "@fastify/static": "^10.1.2",
31
+ "@silentbot1/nat-api": "^0.4.9",
32
+ "chalk": "^5.4.1",
33
+ "commander": "^12.1.0",
34
+ "fastify": "^5.8.5",
35
+ "ffmpeg-static": "^5.3.0",
36
+ "franc": "^6.2.0",
37
+ "get-port": "^7.1.0",
38
+ "node-datachannel": "^0.32.0",
39
+ "parse-torrent": "^11.0.23",
40
+ "uint8-util": "2.2.6",
41
+ "webtorrent": "2.8.5",
42
+ "werift": "^0.24.2",
43
+ "ws": "^8.18.2"
44
+ },
45
+ "devDependencies": {
46
+ "@biomejs/biome": "^2.5.7"
47
+ },
48
+ "overrides": {
49
+ "utp-native": "npm:@torrent-tv/utp-native@2.5.3-ttv.8"
50
+ }
51
+ }
@@ -274,7 +274,7 @@ function makeSendQueueWatcher({ log, getTransportSnapshot, witness, usrsctpState
274
274
  // would be cleared a second after the wedged channel set it and the line
275
275
  // would print for every second of a 54-minute episode.
276
276
  let wedgeSaid = false;
277
- let lastStuckLogAt = 0;
277
+ let lastStuckLogAt = 0;
278
278
  let connection = connections.get(sessionId);
279
279
  if (!connection) {
280
280
  connection = {
@@ -481,7 +481,7 @@ function makeSendQueueWatcher({ log, getTransportSnapshot, witness, usrsctpState
481
481
  `received=${snapshot.bytesReceived}${recvDelta === null ? "" : ` (+${recvDelta})`} ` +
482
482
  `rtt=${snapshot.rtt}ms pc=${snapshot.state} ice=${snapshot.iceState} pair=${snapshot.pair}`
483
483
  );
484
- }
484
+ }
485
485
  // Roadmap item 11: ask for the packet-level truth the moment the wedge is
486
486
  // CERTAIN, not after a chosen delay. The three facts below are not
487
487
  // ambiguous together — the queue has not fallen, the accepted-byte
@@ -1305,5 +1305,3 @@ const SEND_QUEUE_STUCK_MS = 5_000;
1305
1305
  const DC_BUFFER_HIGH_WATER = 8 * 1024 * 1024;
1306
1306
  /** Resume sending once the channel buffer drains to this many bytes. */
1307
1307
  const DC_BUFFER_LOW_WATER = 1 * 1024 * 1024;
1308
- /** Safety fallback so the send loop cannot deadlock on a missed drain event. */
1309
- const DC_BUFFER_DRAIN_TIMEOUT_MS = 5000;