fix(proxy): stop per-tab referer wipe and concurrent DNR rule race
CI / test (pull_request) Successful in 28s
CI / test (pull_request) Successful in 28s
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.
This commit is contained in:
1 parent
66c621825f
commit
e3b904783f
3 files changed
+333
-42
No files matched your search
@@ -7,6 +7,7 @@ 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();
|
||||
|
||||
Reference in new issue
Block a user