fix: handle Chrome browser version mismatch in base profile#153
fix: handle Chrome browser version mismatch in base profile#153
Conversation
When ChromeDriver's version doesn't match the installed Chrome browser, extract the installed version from the error message and retry initialization with the correct version_main parameter to allow compatibility with any Chrome version.
Deploying streamstorm-ui with
|
| Latest commit: |
fe5daec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://024e9028.streamstorm.pages.dev |
| Branch Preview URL: | https://feat-any-chrome-version.streamstorm.pages.dev |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe change adds error handling to Chrome initialization in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
|
@coderabbitai generate changelog in markdown format |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1442 🏁 Script executed: Length of output: 1314
# Changelog
## [Unreleased]
### Bug Fixes
- **Chrome version mismatch auto-recovery** (`src/Engine/lib/core/UndetectedDrivers.py`)
- Wrapped the `Chrome` driver initialization in `initiate_base_profile()` with a
`try/except` block to gracefully handle ChromeDriver ↔ Chrome version mismatches.
- When the exception message contains `"Current browser version is"`, the installed
Chrome major version is extracted from the error message using a regex pattern and
the driver is re-initialized with the correct `version_main` parameter automatically.
- All other initialization failures are re-raised as a `RuntimeError` with a
descriptive message, preserving the original exception as context.
- Added `from re import search` to support the version extraction logic.
### Improvements
- Eliminates the need for manual `version_main` configuration when ChromeDriver and
the locally installed Chrome browser are on different versions.
- Improves reliability and resilience of browser initialization across diverse
environments and Chrome update cycles.
### Files Changed
| File | Additions | Deletions |
|------|-----------|-----------|
| `src/Engine/lib/core/UndetectedDrivers.py` | +17 | -3 | |
When ChromeDriver's version doesn't match the installed Chrome browser, extract the installed version from the error message and retry initialization with the correct version_main parameter to allow compatibility with any Chrome version.
Summary by CodeRabbit
Release Notes