Skip to content

Cancel stale direct-access actions when filtering is disabled - #78

Open
absurd wants to merge 1 commit into
varshneydevansh:masterfrom
absurd:test/issue-77
Open

Cancel stale direct-access actions when filtering is disabled#78
absurd wants to merge 1 commit into
varshneydevansh:masterfrom
absurd:test/issue-77

Conversation

@absurd

@absurd absurd commented Sep 4, 2026

Copy link
Copy Markdown

Builds on 006a61b5 (base branch checked at 8501582b). Addresses the remaining timer races in #77.

Disabling filtering after watch-page enforcement has queued work can still trigger a playlist click or let a retry restore the old enabled settings. For example, the player is released when Disabled is selected, but a 1300 ms retry can subsequently pass the captured enabled settings into applyDOMFallback() and block it again.

This change tracks the three delayed admission actions, cancels them when the guard is released or switches videos, and invalidates already queued callbacks with a generation counter. Before acting, callbacks check the current enabled state, blocked decision and video identity. Both retries now call applyDOMFallback(null, ...) to use current settings. Playlist navigation resolves its allowed target again at execution time.

Tests

  • Adds 14 executable playback regression tests and npm run test:direct-access.
  • Regression suite: 6/14 pass on untouched upstream; 14/14 pass with this patch.
  • New regression suite + existing admission + filter-engine suites: 84/84 pass.
  • Updated existing side-effect assertion: passes separately.
  • JavaScript syntax and git diff --check: pass.
  • Positive controls retain enabled keyword blocking and navigation to an allowed playlist successor.
  • Covers disabled playback, guard/overlay release, metadata recheck cancellation, channel redirect suppression, both delayed retries, queued clicks, rapid disable/re-enable, route changes, and latest-rule target resolution.

The tests execute production admission functions using controlled DOM/media and collaborator fixtures plus simulated timers. The outer fallback dispatcher is represented by an adapter. They are not full-extension/live Firefox tests.

Baseline limitations

The broader suites were run on both untouched 8501582b and the patch in the same environment. They have identical failing test names and counts:

Lane Tests Pass Fail, both versions
smoke 302 259 43
DOM 143 82 61
blocking 208 149 59

These baseline failures include stale source/audit expectations and environment-dependent checks. This PR does not claim full-suite or live-browser certification and does not rewrite unrelated audit fixtures.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@absurd is attempting to deploy a commit to the varshneydevansh's projects Team on Vercel.

A member of the Team first needs to authorize it.

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