fix(auth): remove headed probe cache and add settling delay#70
Merged
fix(auth): remove headed probe cache and add settling delay#70
Conversation
The headless-to-headed browser handoff during auth wall detection was failing because canLaunchHeaded() cached a stale false result and the Chromium process had not fully released OS resources before the headed probe launched. Remove the _headedResult cache so each auth wall event gets a fresh probe, add a retry loop (2 attempts with 500ms backoff), log errors on final failure, and insert a 500ms settling delay between closeBrowser and canLaunchHeaded in the goto auth wall path.
…scope Move playwright require inside try/catch so MODULE_NOT_FOUND is handled by retry logic. Add two behavioral tests: - canLaunchHeaded returns false without DISPLAY env vars - canLaunchHeaded re-evaluates on each call (no stale cache)
- Use console.warn instead of console.error for [WARN] level message
to match codebase conventions (web-ctl.js uses console.warn throughout)
- Add behavioral test for WAYLAND_DISPLAY env var support
- Keep require('playwright') inside try/catch to handle missing module
Keep both auth wall headed checkpoint fix tests and new waitForLoaded feature tests from main.
avifenesh
added a commit
that referenced
this pull request
Feb 25, 2026
Keep improved timeout validation from feature branch and incorporate auth wall checkpoint tests from main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
canLaunchHeaded()fails because Chromium OS-level cleanup hasn't finished aftercloseBrowser()resolves_headedResultcache that prevented retry after transient failurescanLaunchHeaded()for transient resource contentioncloseBrowser()andcanLaunchHeaded()in the goto auth wall pathRoot Cause
When
gotodetects an auth wall, it closes the headless browser and immediately callscanLaunchHeaded(). The probe launch fails because Chromium hasn't released OS resources yet (file locks, display). The failure was permanently cached in_headedResult, preventing any retry.Test Plan
npm run validatepassesCloses #67