Skip to content

Add app_closed Mixpanel event - #24902

Merged
insomnious merged 6 commits into
masterfrom
feat/app-closed-event
Nov 16, 2026
Merged

insomnious merged 6 commits into
masterfrom
feat/app-closed-event

Conversation

@insomnious

Copy link
Copy Markdown
Contributor

Adds app_closed with is_relaunch (true when Vortex restarts itself through relaunch()) and session_duration_ms.

It can't use trackEvent: mixpanel-browser's batch queue waits on a timer that never fires during beforeunload, so the event is lost. trackEventOnExit sends it by sendBeacon with send_immediately instead. See "Events at quit" in docs/analytics.md.

It isn't sent on a crash, a killed process, File > Close or the Quit buttons on error dialogs (those use app.exit(), which skips beforeunload). Nor is it sent when you're logged out or analytics is off. The File > Close part is from reading the code, not tested. Auto-update installs report is_relaunch: false.

Tested in dev: X, Alt+F4 and a restart from Settings > Interface all arrived in the dev Mixpanel project with the right properties. pnpm run verify passes. E2E not run.

@insomnious
insomnious requested a review from a team as a code owner November 13, 2026 21:45
@insomnious insomnious self-assigned this Nov 15, 2026
@insomnious
insomnious merged commit 88a1873 into master Nov 16, 2026
11 checks passed
@insomnious
insomnious deleted the feat/app-closed-event branch November 16, 2026 23:33
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