Skip to content

fix: electron debug off#477

Merged
k11kirky merged 1 commit intomainfrom
01-12-fix_electron_debug_off
Jan 12, 2026
Merged

fix: electron debug off#477
k11kirky merged 1 commit intomainfrom
01-12-fix_electron_debug_off

Conversation

@k11kirky
Copy link
Contributor

@k11kirky k11kirky commented Jan 12, 2026

TL;DR

Improved PostHog session recording in Electron by switching to a more reliable recorder implementation and explicitly starting recording after initialization.

What changed?

  • Replaced posthog-js/dist/lazy-recorder with posthog-js/dist/posthog-recorder to ensure recording is ready immediately
  • Removed unnecessary configuration options (capture_pageview, capture_pageleave, and debug: true)
  • Added explicit call to posthog.startSessionRecording() after PostHog loads
  • Removed the delayed logSessionRecordingStatus() call that was using setTimeout

How to test?

  1. Run the application in development mode
  2. Check the logs for "PostHog loaded" and "Session recording started" messages
  3. Verify in PostHog dashboard that session recordings are being captured correctly

Why make this change?

The previous implementation had reliability issues with session recording in Electron. Since Electron doesn't have the same page navigation events as a browser, we need to explicitly start session recording. Using the full recorder implementation instead of the lazy-loader ensures the recording functionality is available immediately after initialization.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@k11kirky k11kirky marked this pull request as ready for review January 12, 2026 22:27
@k11kirky k11kirky requested a review from a team as a code owner January 12, 2026 22:27
@k11kirky k11kirky merged commit a08925f into main Jan 12, 2026
12 checks passed
@k11kirky k11kirky deleted the 01-12-fix_electron_debug_off branch January 12, 2026 22:49
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