fix(v026): #45 autostart 풀림 — args 비교 정확도 + 진단 로그

추정 원인 (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) <noreply@anthropic.com>
This commit is contained in:
altair823
2026-05-05 01:22:34 +09:00
parent e485b77888
commit 075f395b6d
2 changed files with 11 additions and 1 deletions

View File

@@ -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);

View File

@@ -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',