@torrent-tv/proxy 2.9.106 → 2.9.107

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.9.107
2
+
3
+ - **Fix**: 2.9.106 could not produce a playback plan at all — `Failed to prepare playback plan: firstSegmentMs is not defined`. Moving the two host timings to be read when a plan is ANSWERED removed the two variables but left the object literal still naming them, on the path that builds a fresh plan. My own linter reports it in four seconds and I did not run it, which is the second time an undeclared name has reached a release; `npm publish` now runs it, so this class of error cannot leave the machine again. The test added with 2.9.106 did not catch it because it exercises the cached path only — the fresh-plan path needs a real probe.
4
+
1
5
  ## 2.9.106
2
6
 
3
7
  - **Fix**: The two figures the browser needs to say how long until playback now reach it for the file that needs them most. Both are medians of sessions already finished on this host, and the plan read them at the moment it was BUILT and then cached the result — so the very first file opened after a restart got `null` for both and kept answering `null` for the life of the process, however many sessions ran afterwards. Measured 2026-08-05: a fresh proxy answered `null`, then created the session in 6 ms and produced the first segment in 21 479 ms. They are now read when the plan is ANSWERED, so a cached plan reports what the host currently knows. Covered by tests.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.9.106",
3
+ "version": "2.9.107",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "publishConfig": {
@@ -17,7 +17,8 @@
17
17
  "start": "node ./bin/cli.js",
18
18
  "dev": "node --inspect=0 --experimental-network-inspection ./bin/cli.js",
19
19
  "test": "node --test",
20
- "lint": "biome lint ."
20
+ "lint": "biome lint .",
21
+ "prepublishOnly": "npm run lint"
21
22
  },
22
23
  "dependencies": {
23
24
  "@fastify/cors": "^11.2.0",
@@ -453,11 +453,11 @@ export function createPlaybackPlanner({
453
453
  // Full track inventory for the browser's audio/subtitle menus.
454
454
  audioTracks: audioTracks ?? [],
455
455
  subtitleTracks: subtitleTracks ?? [],
456
- // What this host has recently taken to make a session's first segment.
457
- // Null until one has finished since startup.
458
- expectedFirstSegmentMs: firstSegmentMs,
459
- // Second term of the browser's estimate; see research/playback-eta-2026-08-05.md.
460
- expectedSessionCreateMs: sessionCreateMs
456
+ // Both host timings are filled in by `withHostTimings` on the way out,
457
+ // never here: read at build time they would be frozen into the cached
458
+ // plan, which is the bug fixed in 2.9.106.
459
+ expectedFirstSegmentMs: null,
460
+ expectedSessionCreateMs: null
461
461
  };
462
462
  // Only cache a plan whose codecs were actually detected. An empty probe is
463
463
  // a "header not downloaded yet" signal, not a valid result — caching it