Skip to content

feat: add Kadam popunder trial - #153

Open
AlejandroAkbal wants to merge 4 commits into
mainfrom
feat/kadam-popunder
Open

feat: add Kadam popunder trial#153
AlejandroAkbal wants to merge 4 commits into
mainfrom
feat/kadam-popunder

Conversation

@AlejandroAkbal

@AlejandroAkbal AlejandroAkbal commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • add Kadam as a 10% popunder trial and reduce ProfitOn from 25% to 15%
  • support provider-specific omission of crossorigin through the existing Nuxt/Unhead loader
  • load Kadam directly with no provider container, target class, or extra DOM markup
  • include Kadam in the existing passive debug harness and provider-weight coverage

Verification

  • real Kadam tag loaded in the dedicated no-ad-block Testing Chrome profile with zero .hneuyk427249 elements
  • real provider configuration reports nthClick: 1 and next: 1200
  • first genuine click opened exactly one external ad tab; the original debug page survived
  • after 12 seconds, the second genuine click opened no ad and followed the expected same-origin R34 link
  • no duplicate delivery or destructive source-tab replacement occurred
  • one auxiliary identity-sync request reported ERR_BLOCKED_BY_CLIENT, but the tag, bid request, and accepted delivery completed successfully
  • browser regression verifies Kadam loads without a crossorigin attribute
  • focused Vitest: 5 tests passed
  • Prettier, ESLint, Nuxt typecheck, production build, and git diff check passed

Scope

No provider settings, browser blocker settings, code outside this PR, or deployment state were changed during verification.

Summary by CodeRabbit

  • New Features

    • Added Kadam as a supported popunder advertising provider.
    • Added provider-specific script loading behavior for improved compatibility.
    • Enhanced the popunder debugging page to track script loading and errors.
  • Bug Fixes

    • Adjusted provider selection weights, including a reduced weighting for Profiton.
  • Tests

    • Added coverage verifying provider weights and Kadam’s script configuration.
    • Added end-to-end validation of Kadam script loading.

@AlejandroAkbal

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 70fd0014-ad46-4c0f-9314-eb0aa217d2a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Popunder provider loading

Layer / File(s) Summary
Provider metadata and runtime loading
app/composables/useAdvertisements.ts, test/assets/popunder-provider-weights.test.ts
Adds Kadam metadata, adjusts Profiton’s weight, and applies provider-specific crossorigin settings during initialization.
Debug-page provider injection
app/pages/__ad-debug/popunder.vue, test/pages/popunder-debug.test.ts
Resolves the armed provider and injects its script through Nuxt head configuration. The tests verify Kadam script loading without a crossorigin attribute.

Sequence Diagram(s)

sequenceDiagram
  participant DebugPage
  participant NuxtHead
  participant KadamScript
  DebugPage->>DebugPage: Resolve armed provider
  DebugPage->>NuxtHead: Configure deferred script
  NuxtHead->>KadamScript: Inject script without crossorigin
  KadamScript-->>DebugPage: Report load or error
Loading

Possibly related PRs

  • Rule-34/App#148: Extends the same popunder provider definitions and debug-page script flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding Kadam as a popunder trial.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/kadam-popunder
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/kadam-popunder

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/assets/popunder-provider-weights.test.ts`:
- Around line 9-16: Add a direct assertion in the regression test alongside the
Kadam check that locates the provider with key “profiton” and verifies its
weight is exactly 0.15, while preserving the existing Kadam and aggregate-weight
assertions.

In `@test/pages/popunder-debug.test.ts`:
- Line 13: Replace the source-text assertion in the popunder debug page test
with a Nuxt test-utils Playwright browser test that invokes the page’s armAds
flow, then inspect the DOM to verify provider injection creates the Kadam
container and the injected script omits the crossorigin attribute. Follow the
existing frontend test setup and use `@nuxt/test-utils` browser mode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b449d2d1-e0e5-4c0a-9677-d2037ab9e3c7

📥 Commits

Reviewing files that changed from the base of the PR and between f509f91 and 7961ae9.

📒 Files selected for processing (4)
  • app/composables/useAdvertisements.ts
  • app/pages/__ad-debug/popunder.vue
  • test/assets/popunder-provider-weights.test.ts
  • test/pages/popunder-debug.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
test/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

test/**/*.{test,spec}.{ts,tsx}: Use Vitest with @nuxt/test-utils and Playwright browser mode for testing
Use @nuxt/test-utils with Playwright inside describe blocks calling await setup({ browser: true })
Mock server-side API calls via test-only Nitro plugin at test/server-mocks/plugin.ts injected through nuxt.config.ts $test.nitro.plugins
Use debugBrowserOptions from test/helper.ts for headful Playwright playback with slowMo in tests
Keep repository/pure modules importable through relative paths in plain Vitest suites that do not get Nuxt's runtime alias resolution
Use fetch from @nuxt/test-utils with { redirect: 'manual' } to access redirect status and Location headers; @nuxt/test-utils $fetch has no .raw method
Import localeCodes, prefixedLocaleCodes, and removedLocaleCodes from config/i18n in tests instead of hardcoding locale lists

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
**/*.{vue,ts,tsx,js,jsx,json,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for formatting with 120-char print width, no semicolons, single quotes, trailing commas removed, and single attribute per line in Vue templates

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
  • app/pages/__ad-debug/popunder.vue
  • app/composables/useAdvertisements.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use Nuxt flat ESLint via @nuxt/eslint for linting

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
  • app/pages/__ad-debug/popunder.vue
  • app/composables/useAdvertisements.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Define locales in config/i18n.ts as the single source of truth; do not hardcode locale lists in application code
Use PocketBase batch writes for multi-record replacement/reorder operations instead of one HTTP write per changed row

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
  • app/pages/__ad-debug/popunder.vue
  • app/composables/useAdvertisements.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: For URL validation/parsing, prefer URL.canParse() or URL.parse() over constructor try/catch
Use URL.parse() when the parsed URL object is needed, with URL.canParse() fallback in browser code if compatibility matters

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
  • app/composables/useAdvertisements.ts
app/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

app/**/*.{vue,ts,tsx}: Use Nuxt 4 with Vue 3 and TypeScript for the frontend application
Use useLazyToast() to lazy-load vue-sonner; wait for ClientToaster to mount before calling toast.* using a proper async wait instead of plain nextTick()
Build reordered array synchronously instead of reading VueUse moveArrayElement() result before nextTick for state immediately persisted

Files:

  • app/pages/__ad-debug/popunder.vue
  • app/composables/useAdvertisements.ts
app/**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

app/**/*.vue: Use project.urls.production for canonical URLs to point to production (https://r34.app/...) even when served from clone domains
Keep breadcrumb Schema.org source item URLs local/locale-relative; do not convert to project.urls.production since nuxt-schema-org resolves against site.url
When triggering a premium prompt from a nested dialog/bottom sheet, let the sheet owner close local UI, open the prompt, and restore UI after prompt closes
Premium auth transitions are reload-backed in dashboard/sign-in flow; rely on page reload to clear memory state instead of tracking PocketBase user ids in useState

Files:

  • app/pages/__ad-debug/popunder.vue
app/pages/**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

app/pages/**/*.vue: Use useSeoMeta in page components for page-specific tags (title, description)
Use flat bracket keys (filter[sort], filter[rating], etc.) with Vue Router's default query handling; do not re-add qs for nested route.query.filter objects unless URL contract changes
Keep @formkit/auto-animate route-scoped unless used broadly; use local vAutoAnimate imports on specific pages instead of global directive
Keep TanStack infinite-query data raw and apply blocklist hiding in page-level computed rows; do not mutate query pages in select with selectedBlockList
Query filters use flat bracket keys (filter[sort], filter[rating]) with Vue Router default query handling

Files:

  • app/pages/__ad-debug/popunder.vue
🧠 Learnings (1)
📚 Learning: 2026-06-22T07:50:54.935Z
Learnt from: AlejandroAkbal
Repo: Rule-34/App PR: 144
File: test/server/fix-canonical-queries.test.ts:174-178
Timestamp: 2026-06-22T07:50:54.935Z
Learning: In this Nuxt 3/4 project using `nuxt-schema-org` (v6.2.1), breadcrumb `source`/`itemListElement` URL values may be provided via `localePath()` (locale-relative in source code), but `nuxt-schema-org` renders JSON-LD with production-absolute URLs using `site.url` during schema rendering. When asserting JSON-LD breadcrumb `itemListElement` URLs in tests, expect production-absolute URLs (e.g., prefix with `project.urls.production.origin`), not the locale-relative `localePath()` forms. Do not flag production-absolute URL strings in JSON-LD breadcrumb tests as incorrect.

Applied to files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
🔇 Additional comments (2)
app/composables/useAdvertisements.ts (1)

74-74: LGTM!

Also applies to: 86-105, 229-238, 257-263, 273-273

app/pages/__ad-debug/popunder.vue (1)

3-9: LGTM!

Also applies to: 181-194, 213-214

Comment thread test/assets/popunder-provider-weights.test.ts
Comment thread test/pages/popunder-debug.test.ts Outdated
@AlejandroAkbal

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AlejandroAkbal

Copy link
Copy Markdown
Member Author

Real pre-production delivery verified in Chrome Testing/Profile 1. The live Kadam tag returned nthClick: 1 and next: 1200; the first genuine click opened exactly one external ad tab while the source debug page survived. After 12 seconds, the second genuine click opened no ad and followed the expected R34 target link. No duplicate or destructive redirect occurred. One auxiliary identity-sync request was blocked by the client, but it did not prevent the tag, bid request, or accepted delivery.

@AlejandroAkbal

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/pages/popunder-debug.test.ts (1)

8-11: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Use debug browser options for the tracked page.

defaultSetupConfig enables Playwright mode with browser: true, but useTrackedPageFactory() still creates pages with createPage() and no browserOptions. Apply debugBrowserOptions here unless another debug helper is intended.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/pages/popunder-debug.test.ts` around lines 8 - 11, Update the tracked
page setup in the “popunder debug page” suite so useTrackedPageFactory receives
debugBrowserOptions when creating pages. Ensure the factory uses those browser
options instead of relying on createPage’s defaults, while preserving the
existing defaultSetupConfig setup.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@test/pages/popunder-debug.test.ts`:
- Around line 8-11: Update the tracked page setup in the “popunder debug page”
suite so useTrackedPageFactory receives debugBrowserOptions when creating pages.
Ensure the factory uses those browser options instead of relying on createPage’s
defaults, while preserving the existing defaultSetupConfig setup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: baab008d-d9e8-40e2-9b90-6451c813a86c

📥 Commits

Reviewing files that changed from the base of the PR and between bddc4d1 and e004d87.

📒 Files selected for processing (4)
  • app/composables/useAdvertisements.ts
  • app/pages/__ad-debug/popunder.vue
  • test/assets/popunder-provider-weights.test.ts
  • test/pages/popunder-debug.test.ts
💤 Files with no reviewable changes (2)
  • app/pages/__ad-debug/popunder.vue
  • app/composables/useAdvertisements.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
test/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

test/**/*.{test,spec}.{ts,tsx}: Use Vitest with @nuxt/test-utils and Playwright browser mode for testing
Use @nuxt/test-utils with Playwright inside describe blocks calling await setup({ browser: true })
Mock server-side API calls via test-only Nitro plugin at test/server-mocks/plugin.ts injected through nuxt.config.ts $test.nitro.plugins
Use debugBrowserOptions from test/helper.ts for headful Playwright playback with slowMo in tests
Keep repository/pure modules importable through relative paths in plain Vitest suites that do not get Nuxt's runtime alias resolution
Use fetch from @nuxt/test-utils with { redirect: 'manual' } to access redirect status and Location headers; @nuxt/test-utils $fetch has no .raw method
Import localeCodes, prefixedLocaleCodes, and removedLocaleCodes from config/i18n in tests instead of hardcoding locale lists

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
**/*.{vue,ts,tsx,js,jsx,json,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for formatting with 120-char print width, no semicolons, single quotes, trailing commas removed, and single attribute per line in Vue templates

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use Nuxt flat ESLint via @nuxt/eslint for linting

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Define locales in config/i18n.ts as the single source of truth; do not hardcode locale lists in application code
Use PocketBase batch writes for multi-record replacement/reorder operations instead of one HTTP write per changed row

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: For URL validation/parsing, prefer URL.canParse() or URL.parse() over constructor try/catch
Use URL.parse() when the parsed URL object is needed, with URL.canParse() fallback in browser code if compatibility matters

Files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
🧠 Learnings (1)
📚 Learning: 2026-06-22T07:50:54.935Z
Learnt from: AlejandroAkbal
Repo: Rule-34/App PR: 144
File: test/server/fix-canonical-queries.test.ts:174-178
Timestamp: 2026-06-22T07:50:54.935Z
Learning: In this Nuxt 3/4 project using `nuxt-schema-org` (v6.2.1), breadcrumb `source`/`itemListElement` URL values may be provided via `localePath()` (locale-relative in source code), but `nuxt-schema-org` renders JSON-LD with production-absolute URLs using `site.url` during schema rendering. When asserting JSON-LD breadcrumb `itemListElement` URLs in tests, expect production-absolute URLs (e.g., prefix with `project.urls.production.origin`), not the locale-relative `localePath()` forms. Do not flag production-absolute URL strings in JSON-LD breadcrumb tests as incorrect.

Applied to files:

  • test/pages/popunder-debug.test.ts
  • test/assets/popunder-provider-weights.test.ts
🔇 Additional comments (2)
test/assets/popunder-provider-weights.test.ts (1)

10-16: LGTM!

test/pages/popunder-debug.test.ts (1)

23-45: LGTM!

@AlejandroAkbal

Copy link
Copy Markdown
Member Author

CodeRabbit current-head finding disposition: no change. debugBrowserOptions is explicitly documented for manual page.pause() debugging and launches headed Chromium with slowMo: 1000 plus DevTools. This test already inherits defaultBrowserOptions through setup(defaultSetupConfig), matching the repository page-test pattern. Passing debug-only options into the tracked-page factory would require widening a shared helper and would make CI slower/headed without improving coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant