From ad0f58e328f4cabd630fd20054d824bdd6f4af15 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 26 Jan 2026 07:35:34 -0500 Subject: [PATCH 1/3] Use meta bucket in R2 bucket resolution --- js/services/r2Service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/services/r2Service.js b/js/services/r2Service.js index 38daca69..036d9545 100644 --- a/js/services/r2Service.js +++ b/js/services/r2Service.js @@ -475,7 +475,8 @@ class R2Service { // We no longer support automated bucket creation or domain management via API token. // We assume the user has created the bucket with the correct name and configured the public domain. - const bucketName = settings.bucket || sanitizeBucketName(npub); + const bucketName = + settings.bucket || settings.meta?.bucket || sanitizeBucketName(npub); // We attempt to ensure the bucket exists and CORS is set up using the S3 keys if possible. if (accessKeyId && secretAccessKey) { From 5f1f6593082eb94e1067e5e0d9398de480fc0163 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:37:03 +0000 Subject: [PATCH 2/3] Add minimal reproducer for Moderation UI bug - Adds examples/reproducers/issue-moderation-ui/repro.spec.ts - Adds examples/reproducers/issue-moderation-ui/README.md - Adds examples/reproducers/issue-moderation-ui/playwright.config.ts - Reproduces failure in 'Show anyway' button visibility check --- .../reproducers/issue-moderation-ui/README.md | 19 +++++ .../issue-moderation-ui/playwright.config.ts | 23 +++++++ .../issue-moderation-ui/repro.spec.ts | 69 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 examples/reproducers/issue-moderation-ui/README.md create mode 100644 examples/reproducers/issue-moderation-ui/playwright.config.ts create mode 100644 examples/reproducers/issue-moderation-ui/repro.spec.ts diff --git a/examples/reproducers/issue-moderation-ui/README.md b/examples/reproducers/issue-moderation-ui/README.md new file mode 100644 index 00000000..46c3bbdd --- /dev/null +++ b/examples/reproducers/issue-moderation-ui/README.md @@ -0,0 +1,19 @@ +# Moderation UI "Show Anyway" Bug Reproducer + +This reproducer demonstrates the failure of the "Show anyway" button visibility check and click action in the moderation UI fixtures. + +## Issue Description + +In the moderation UI tests, the "Show anyway" button fails to be visible or clickable in the test environment (headless mode), even though the logic seems correct. This prevents verifying the "show anyway" override functionality. + +## Running the Reproducer + +To run the reproducer script: + +```bash +npx playwright test examples/reproducers/issue-moderation-ui/repro.spec.ts +``` + +## Expected Result + +The test should fail with a timeout waiting for the "Show anyway" button to be visible or clickable. diff --git a/examples/reproducers/issue-moderation-ui/playwright.config.ts b/examples/reproducers/issue-moderation-ui/playwright.config.ts new file mode 100644 index 00000000..513c3e22 --- /dev/null +++ b/examples/reproducers/issue-moderation-ui/playwright.config.ts @@ -0,0 +1,23 @@ +import baseConfig from '../../../playwright.config.ts'; +import { defineConfig } from '@playwright/test'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const repoRoot = path.resolve(__dirname, '../../..'); + +export default defineConfig({ + ...baseConfig, + testDir: './', + webServer: { + ...baseConfig.webServer, + cwd: repoRoot, + }, + projects: [ + { + name: 'repro', + testMatch: '**/*.spec.ts', + use: baseConfig.projects?.[0]?.use, + }, + ], +}); diff --git a/examples/reproducers/issue-moderation-ui/repro.spec.ts b/examples/reproducers/issue-moderation-ui/repro.spec.ts new file mode 100644 index 00000000..57ced734 --- /dev/null +++ b/examples/reproducers/issue-moderation-ui/repro.spec.ts @@ -0,0 +1,69 @@ +import { expect, test } from "@playwright/test"; + +const FIXTURE_URL = "/docs/moderation/fixtures/index.html"; +const STORAGE_KEY = "bitvid:moderation:fixture-overrides"; +const SENTINEL_KEY = "__moderationFixturesInit__"; +const RESTORE_BUTTON_LABEL = "Restore default moderation"; + +async function waitForFixtureReady(page) { + await page.waitForSelector('body[data-ready="true"]'); +} + +function setupStorageReset(page) { + return page.addInitScript(({ storageKey, sentinelKey }) => { + try { + const session = window.sessionStorage; + const local = window.localStorage; + if (session && !session.getItem(sentinelKey)) { + local?.removeItem(storageKey); + session.setItem(sentinelKey, "1"); + } + } catch { + /* ignore reset failures in tests */ + } + }, { storageKey: STORAGE_KEY, sentinelKey: SENTINEL_KEY }); +} + +test.beforeEach(async ({ page }) => { + await setupStorageReset(page); +}); + +test.afterEach(async ({ page }) => { + try { + await page.evaluate(({ key, sentinel }) => { + window.localStorage?.removeItem(key); + window.sessionStorage?.removeItem(sentinel); + }, { key: STORAGE_KEY, sentinel: SENTINEL_KEY }); + } catch { + // ignore cleanup errors when page already closed + } +}); + +test.describe("moderation fixtures reproducer", () => { + test("show anyway override persists across reloads", async ({ page }) => { + await page.goto(FIXTURE_URL, { waitUntil: "networkidle" }); + await waitForFixtureReady(page); + + const overrideCard = page.locator('[data-test-id="show-anyway"]'); + const thumbnail = overrideCard.locator('img[data-video-thumbnail]'); + + await expect(overrideCard).toHaveAttribute( + "data-moderation-override-available", + "true" + ); + const showAnywayButton = overrideCard.getByRole("button", { name: "Show anyway" }); + const restoreButtonQuery = overrideCard.getByRole("button", { + name: RESTORE_BUTTON_LABEL, + }); + + await expect(overrideCard).toHaveAttribute("data-autoplay-policy", "blocked"); + await expect(thumbnail).toHaveAttribute("data-thumbnail-state", "blurred"); + + // Uncommenting the failing check to reproduce the bug + await expect(showAnywayButton).toBeVisible(); + await expect(restoreButtonQuery).toHaveCount(0); + + // Uncommenting the failing action to reproduce the bug + await showAnywayButton.click({ force: true }); + }); +}); From 5759b9437ab1d3b0cf8b165b4920b0fa8e67ea20 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 26 Jan 2026 07:37:24 -0500 Subject: [PATCH 3/3] Use configured bucket for R2 verification --- js/services/r2Service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/services/r2Service.js b/js/services/r2Service.js index 036d9545..45fbf5ec 100644 --- a/js/services/r2Service.js +++ b/js/services/r2Service.js @@ -575,7 +575,7 @@ class R2Service { return { success: false, error: "Incomplete credentials or missing public URL." }; } - const bucketName = sanitizeBucketName(npub); + const bucketName = settings.bucket || settings.meta?.bucket || sanitizeBucketName(npub); const verifyKey = `.verify-${Date.now()}-${Math.random().toString(36).substring(7)}.txt`; const verifyContent = "bitvid-verification"; const publicUrl = buildPublicUrl(baseDomain, verifyKey);