Skip to content

Bug fixes2 - #15

Merged
bigr merged 2 commits into
mainfrom
klinger-bug-fixes2
Oct 25, 2025
Merged

Bug fixes2#15
bigr merged 2 commits into
mainfrom
klinger-bug-fixes2

Conversation

@bigr

@bigr bigr commented Oct 25, 2025

Copy link
Copy Markdown
Owner

No description provided.

bigr added 2 commits October 25, 2025 23:34
Add pre-flight check to detect when browsers (especially snap-confined) cannot
write to profile directories, preventing cryptic SingletonLock errors at runtime.

The check:
- Creates a temporary test directory in the profile path
- Attempts to write a test file to verify write access
- Provides helpful error message with solutions if write fails
- Automatically cleans up test files

This catches snap confinement issues early and guides users to install
system-packaged browsers instead.

Changes:
- Add _check_browser_profile_access() function to detect write failures
- Call check after profile directory creation in add_app()
- Add integration test for profile write failure detection
- Fix doctor command to use python3 instead of python
- Update browser check test to accept INFO status for Firefox

Execution Report:
- [x] Linting: ruff check src tests (all passed)
- [x] Type checking: mypy src (success)
- [x] Tests: pytest tests/unit tests/integration tests/e2e (384 passed)
- [x] Coverage: 78.39% (required: 60%)
- [x] Pre-commit: all hooks passed
Replace cryptic Click parameter validation errors with helpful, actionable
error messages that guide users to solutions.

**Changes:**
- Create BrowserChoice custom Click type with specific error messages
- Firefox: Explains why not supported (lacks app/SSB mode) + installation guide
- Invalid browsers: Shows supported options + snap confinement warning
- Update main() to catch Click exceptions gracefully without tracebacks
- Display formatted error messages to stderr with exit code 2

**Error Messages:**
- Firefox attempt now shows why it's unsupported and how to install alternatives
- Invalid browser shows supported options and snap confinement guidance
- All errors are user-friendly with no Python tracebacks
@bigr
bigr merged commit 31c37e2 into main Oct 25, 2025
5 checks passed
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