Open
Conversation
- Add sanitize-pii.ts: scrubs URLs (keeps origin, redacts path/query/fragment), email addresses, IPv4 addresses, and known sensitive keys (url, title, cookie, authorization, token, etc.) from all PostHog event and exception properties. Handles nested objects, arrays, exception lists, and stack frame context lines. - Add session.ts: generates a per-app-launch session UUID so all events and exceptions from a single run can be correlated via $session_id. - Update PosthogController: captureEvent and captureException now pipe all properties through sanitizeProperties and inject $session_id. - Update ErrorTracking SDK: autocaptured exceptions now include $session_id and have their properties sanitized before being sent to PostHog. Co-authored-by: Evan <iamEvanYT@users.noreply.github.com>
…e PostHog in dev PostHog disabled in development: - PostHog client is only created when app.isPackaged is true. All captureEvent/captureException calls are no-ops in dev mode. - ErrorTracking autocapture and crash reporter are also skipped. Lifecycle & user action events (via observability.ts): - Tab: tab-created, tab-closed, tab-switched (throttled 500ms) - Window: window-created, window-closed (with windowType) - Space: space-created, space-deleted - Profile: profile-created, profile-deleted - Settings: setting-changed - Onboarding: onboarding-completed - Extensions: extension-installed, extension-uninstalled - Updates: update-available, update-downloaded (deduplicated per version) Performance metrics: - app-ready: includes startupMs (time from module load to app.whenReady) - tab-load-finished: includes loadDurationMs (did-start-loading to did-finish-load) - tab-load-failed: includes errorCode (for main frame failures) Crash reporter: - Electron crashReporter started with sessionId in extras - child-process-gone and render-process-gone events sent to PostHog with process type, reason, and exit code Co-authored-by: Evan <iamEvanYT@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
Contributor
Build artifacts for all platforms are ready! 🚀Download the artifacts for: One-line installer (Unstable):bunx flow-debug-build --open 22825931528(execution 22825931528 / attempt 1) |
Greptile SummaryThis PR significantly improves the PostHog observability infrastructure by adding PII sanitization via a Key changes:
Issues found:
Confidence Score: 2/5
Last reviewed commit: 6d2ea49 |
Member
Author
|
@greptile review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve PostHog observability by adding PII sanitization, session context, comprehensive lifecycle and performance events, and crash reporting, with telemetry disabled in development.