Files
goon_plugin/__tests__/run.mjs
T
kfj001 e3b904783f
CI / test (pull_request) Successful in 28s
fix(proxy): stop per-tab referer wipe and concurrent DNR rule race
Address robot's review on PR #5:

- [Blocking] 'goon_referers' is a host-keyed GLOBAL store and must outlive
  its capture tab; it was wrongly added to the per-tab onRemoved cleanup, so
  closing any tab wiped referers captured by still-open source tabs (-> 412).
  It is no longer removed on tab close. Stale referers are now pruned
  opportunistically in persistReferer via a per-host timestamp + TTL.

- [Should-fix] the DNR referer rule used a single shared REFERER_RULE_ID with
  a non-atomic check+update, so concurrent proxy fetches for two hosts could
  interleave and leave the wrong host's referer live. Each host now gets its
  own stable rule id (refererRuleIdFor) and the install+record is serialized
  per host via an async lock (refererRuleLocks).

- [Coverage] add __tests__/referer_proxy.test.mjs exercising the new
  referer-capture / proxy-host / onRemoved paths: closing a tab preserves
  goon_referers, two hosts proxied concurrently keep distinct per-host rules,
  and same-host proxy is idempotent.
2026-08-25 15:35:24 -07:00

15 lines
418 B
JavaScript

/**
* Test entry point — imports all test suites then runs them.
*/
import './schema.test.mjs';
import './viewer_units.test.mjs';
import './data_flow.test.mjs';
import './viewer_integration.test.mjs';
import './config_validation.test.mjs';
import './hls_qa.test.mjs';
import './referer_proxy.test.mjs';
import { run } from './runner.mjs';
const result = await run();
process.exit(result.totalFailed > 0 ? 1 : 0);