From 075f395b6d2ccbc51bceb9dc5ed423aa38d2cdee Mon Sep 17 00:00:00 2001 From: altair823 Date: Tue, 5 May 2026 01:22:34 +0900 Subject: [PATCH] =?UTF-8?q?fix(v026):=20#45=20autostart=20=ED=92=80?= =?UTF-8?q?=EB=A6=BC=20=E2=80=94=20args=20=EB=B9=84=EA=B5=90=20=EC=A0=95?= =?UTF-8?q?=ED=99=95=EB=8F=84=20+=20=EC=A7=84=EB=8B=A8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 추정 원인 (a)/(b)/(c): - (a) Windows registry path mismatch (NSIS 설치 위치 변경) - (b) electron path canonicalization - (c) args 비교 mismatch — getLoginItemSettings 가 args 와 함께 read 해야 매치 Fix: - tray.ts: getLoginItemSettings({ args: ['--hidden'] }) 명시 — 트레이 checkbox 의 checked 상태가 실제 LoginItem args 와 정합하게 비교 - index.ts firstRun 후: autostart.state 진단 로그 (withArgs vs noArgs 비교 + executableWillLaunchAtLogin) — dogfood 에서 실제 동작 확인 Fix 가 충분하지 않으면 dogfood 로그 분석 후 v0.2.7 deeper fix. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/main/index.ts | 8 ++++++++ src/main/tray.ts | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index 21bb3ca..fbb4155 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -83,6 +83,14 @@ app.whenReady().then(async () => { writeFileSync(initFlag, new Date().toISOString()); logger.info('autostart.enabled.firstRun'); } + // v0.2.6 #45 진단 — 실제 LoginItem 상태 확인 (args 전달 vs 미전달 차이) + const withArgs = app.getLoginItemSettings({ args: [HIDDEN_ARG] }); + const noArgs = app.getLoginItemSettings(); + logger.info('autostart.state', { + withArgs: { openAtLogin: withArgs.openAtLogin, executableWillLaunchAtLogin: withArgs.executableWillLaunchAtLogin }, + noArgs: { openAtLogin: noArgs.openAtLogin, executableWillLaunchAtLogin: noArgs.executableWillLaunchAtLogin }, + expectedArgs: [HIDDEN_ARG] + }); } const db = openDb(paths.dbFile); const repo = new NoteRepository(db); diff --git a/src/main/tray.ts b/src/main/tray.ts index 3f02373..b509994 100644 --- a/src/main/tray.ts +++ b/src/main/tray.ts @@ -74,7 +74,9 @@ function buildMenu() { }); items.push({ label: 'Ollama 설정...', click: () => _runOpenOllamaSettings() }); if (app.isPackaged) { - const { openAtLogin } = app.getLoginItemSettings(); + // v0.2.6 #45 — args 명시 전달로 openAtLogin 비교 정확도. setLoginItemSettings 가 + // args 와 함께 LoginItem 등록하므로 read 시도 같은 args 로 비교해야 매치됨. + const { openAtLogin } = app.getLoginItemSettings({ args: ['--hidden'] }); items.push({ label: '윈도우 시작 시 자동 실행', type: 'checkbox',