Use Electron's native loginItem API for start-at-login instead of the auto-launch package#33999
Open
hayaksi1 wants to merge 1 commit into
Open
Use Electron's native loginItem API for start-at-login instead of the auto-launch package#33999hayaksi1 wants to merge 1 commit into
hayaksi1 wants to merge 1 commit into
Conversation
… auto-launch package The auto-launch npm package failed to actually launch the app at login on macOS — its LaunchAgent plist path resolution for .app bundles is fragile and isn't refreshed across app updates — while still reporting the option as enabled, so "start at login" appeared to work but didn't (element-hq#32303). It is also unmaintained and required a local @types/auto-launch patch. Replace it with Electron's built-in app.setLoginItemSettings / app.getLoginItemSettings. On Windows the login item points at the stable Squirrel Update.exe (--processStart) rather than the versioned executable so it survives updates; openAsHidden / --hidden carry the start-minimised preference. The public AutoLaunch API (getState / setState / AutoLaunchState) is unchanged, so callers are unaffected. Drops the auto-launch dependency, its @types/auto-launch devDependency, and the associated patch.
t3chguy
reviewed
Jun 29, 2026
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.
Problem
The
auto-launchnpm package failed to actually launch the app at login on macOS — itsLaunchAgent plist path resolution for
.appbundles is fragile and isn't refreshed across appupdates — while still reporting the option as enabled. So "start at login" looked like it worked
but didn't (#32303). The package is also unmaintained and required a local
@types/auto-launchpatch to build.
Fix
Replace
auto-launchwith Electron's built-inapp.setLoginItemSettings/app.getLoginItemSettings:openAtLogin, withopenAsHidden/--hiddencarrying the start-minimisedpreference.
Update.exe(--processStart)instead of the versioned executable, so it survives app updates.
The public
AutoLaunchAPI (getState/setState/AutoLaunchState) is unchanged, so callersare unaffected. This also lets us drop the
auto-launchdependency, the@types/auto-launchdevDependency, and the
patches/@types__auto-launch.patchworkaround.Tests
auto-launch.test.ts(Vitest, 6 passing) covers the state matrix (disabled / enabled / minimised)and the platform-specific
setLoginItemSettingsoptions for Windows vs macOS/Linux.Fixes #32303
Notes: Fixes "start at login" silently not working on macOS by using Electron's native loginItem API instead of the unmaintained auto-launch package.
Checklist
public/exportedsymbols have accurate TSDoc documentation.