From ca56590ce12a559853a90dd13970faac865f1c8f Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 25 Oct 2025 15:04:04 -0400 Subject: [PATCH] Remove admin whitelist hide bypass --- js/feedEngine/stages.js | 4 +--- tests/moderation/hide-thresholds.test.mjs | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/js/feedEngine/stages.js b/js/feedEngine/stages.js index ec31406b..eceab94a 100644 --- a/js/feedEngine/stages.js +++ b/js/feedEngine/stages.js @@ -664,9 +664,7 @@ export function createModerationStage({ let hideBypass = ""; if (hideTriggered) { - if (adminWhitelist) { - hideBypass = "admin-whitelist"; - } else if (viewerOverrideActive) { + if (viewerOverrideActive) { hideBypass = "viewer-override"; } else if (feedPolicyBypass) { hideBypass = "feed-policy"; diff --git a/tests/moderation/hide-thresholds.test.mjs b/tests/moderation/hide-thresholds.test.mjs index 10ae7cbe..f276ffba 100644 --- a/tests/moderation/hide-thresholds.test.mjs +++ b/tests/moderation/hide-thresholds.test.mjs @@ -194,7 +194,7 @@ test("moderation stage bypasses hard hides on home feed", async () => { assert.equal(hideWhy.hideBypass, "feed-policy"); }); -test("moderation stage allows admin-whitelisted videos despite hide thresholds", async () => { +test("moderation stage hides admin-whitelisted videos once thresholds fire", async () => { const whitelistedHex = hex("f"); const videoId = hex("4"); @@ -243,18 +243,26 @@ test("moderation stage allows admin-whitelisted videos despite hide thresholds", const result = await stage(items, context); - assert.equal(result.length, 1); + assert.equal(result.length, 0); - const metadata = result[0].metadata.moderation; - assert.equal(metadata.hidden, false); + const metadata = items[0].metadata.moderation; + assert.equal(metadata.hidden, true); assert.equal(metadata.hideReason, "trusted-report-hide"); - assert.equal(metadata.hideBypass, "admin-whitelist"); + assert.equal(metadata.hideBypass ?? null, null); + assert.equal(metadata.adminWhitelist, true); assert.deepEqual(metadata.hideCounts, { trustedMuteCount: 0, trustedReportCount: 6 }); + const videoModeration = items[0].video.moderation; + assert.equal(videoModeration.hidden, true); + assert.equal(videoModeration.hideReason, "trusted-report-hide"); + assert.equal(videoModeration.hideBypass ?? null, null); + assert.deepEqual(videoModeration.hideCounts, { trustedMuteCount: 0, trustedReportCount: 6 }); + const hideWhy = why.find((entry) => entry.reason === "trusted-report-hide"); assert.ok(hideWhy); - assert.equal(hideWhy.hidden, false); - assert.equal(hideWhy.hideBypass, "admin-whitelist"); + assert.equal(hideWhy.hidden, true); + assert.equal(hideWhy.hideBypass ?? null, null); assert.equal(hideWhy.adminWhitelist, true); + assert.equal(hideWhy.trustedReportCount, 6); });