Skip to content

Conversation

@prklm10
Copy link
Contributor

@prklm10 prklm10 commented Dec 3, 2025

This pull request introduces robust handling for browser disconnections during snapshot discovery. The main changes ensure that the browser is automatically restarted if it becomes disconnected or crashes, improving reliability for snapshot operations and retries. Additionally, the default behavior now retries failed snapshot discoveries up to three times. Comprehensive tests have been added to verify browser restart logic and retry behavior.

Browser reliability improvements:

  • Added a restart() method to the Browser class to force-close, reset state, and relaunch the browser instance after disconnection. (packages/core/src/browser.js)
  • Updated the page() method to automatically restart the browser if it is disconnected before creating a new page. (packages/core/src/browser.js)

Snapshot retry enhancements:

  • Changed the default for discovery.retry to true, enabling up to three retries for snapshot discovery failures by default. (packages/core/src/config.js)
  • Improved the retry logic in createDiscoveryQueue to detect browser/session disconnection errors and restart the browser before retrying a snapshot. (packages/core/src/discovery.js, packages/core/src/utils.js) [1] [2]

Testing and validation:

  • Added new tests to verify browser restart on disconnection, automatic restart in page(), and retrying snapshots with browser restart on connection errors. (packages/core/test/discovery.test.js)

@prklm10 prklm10 requested a review from a team as a code owner December 3, 2025 06:39
@github-actions
Copy link

This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the 🍞 stale Closed due to inactivity label Dec 23, 2025
@prklm10 prklm10 added ✨ enhancement New feature or request and removed 🍞 stale Closed due to inactivity labels Dec 24, 2025
@prklm10 prklm10 merged commit 285d4ad into master Dec 24, 2025
57 of 58 checks passed
@prklm10 prklm10 deleted the PER-5295 branch December 24, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants