Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Explorer launch and window handling #100

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

cyaiox
Copy link
Collaborator

@cyaiox cyaiox commented Feb 7, 2025

Fix Explorer launch and window handling

Context and scope

The launcher was experiencing issues with the Explorer launch process and window handling, particularly:

  1. Inconsistent process startup detection
  2. Race conditions between window closing and process initialization
  3. Potential analytics events being lost during app quit

Changes

  • Added robust process startup verification using process.kill(pid, 0) check
  • Improved process monitoring with stdout/stderr capture for better debugging
  • Added timeout handling for process startup (10 seconds)
  • Separated window closing logic from analytics tracking
  • Enhanced error handling and logging during process launch
  • Added proper process state tracking with hasStarted flag

Technical details

  • Process verification now waits 2 seconds after spawn to ensure stability
  • Added proper cleanup of timeouts in all process events
  • Improved error messages with specific failure reasons
  • Analytics events are now properly tracked in the before-quit event
  • Window closing is handled separately to prevent visual flashing

Additional notes

  • The timeout values (10s for overall, 2s for stability check) can be adjusted if needed
  • Added more detailed logging to help with future debugging
  • Process stdout/stderr are now captured for better issue diagnosis

@cyaiox cyaiox merged commit 7108c78 into main Feb 7, 2025
9 checks passed
@cyaiox cyaiox deleted the fix/send-segment-events branch February 7, 2025 17:45
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.

2 participants