Skip to content

Verify and document graceful degradation when no slots match the request URL #700

@prk-Jr

Description

@prk-Jr

Context

When no creative-opportunities.toml slots match the incoming request URL, the following guards prevent any partial auction or injection state:

Guard Location Effect
should_run_auction = false publisher.rs:905 No auction dispatched
ad_slots_script = None publisher.rs:985 window.__ts_ad_slots not injected
winning_bids = {} publisher.rs:1457 No bid data produced
has_slots guard html_processor.rs:305 window.__ts_bids script entirely skipped

No </body> hold occurs. The page streams unmodified. GAM falls back to its own auction.

Action

  • Add explicit tests in publisher.rs verifying zero injection when slot match is empty (currently covered implicitly but not as a named case)
  • Confirm behavior when creative_opportunities config section is present but creative-opportunities.toml has zero slots (kill-switch path per spec §8)
  • Log a debug message at the no-match gate so operators can confirm the feature is inactive on non-article URLs

Parent: #677


Resolution

Verified and documented. Gate condition at publisher.rs:905-906:

let should_run_auction =
    is_get && !is_prefetch && !is_bot && !matched_slots.is_empty() && consent_allows_auction;

When matched_slots.is_empty():

  • should_run_auction = falsedispatched_auction = None — no PBS call, no SSP requests fired
  • Origin request proxied and returned to the user unchanged
  • Debug log fires at publisher.rs:908-913: "No creative opportunity slots matched path '{}' — skipping auction and injection"

Kill-switch path confirmed: When creative_opportunities config section is present but creative-opportunities.toml has zero slots, match_slots() returns an empty vec — same gate fires, auction skipped, page unaffected.

Operator visibility: Debug log added. Operators can confirm the feature is inactive on non-article URLs by checking logs for the no-match message.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions