Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5143ab1ad | ||
|
|
2221113329 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -3,6 +3,24 @@
|
||||
본 파일은 Inkling 의 버전별 사용자 영향 변경 사항을 기록한다.
|
||||
형식은 [Keep a Changelog](https://keepachangelog.com/) 를 느슨하게 따른다.
|
||||
|
||||
## [0.3.3] — 2026-05-10
|
||||
|
||||
v0.3.0 Cut E (양방향 sync) dogfood 첫 시도 중 발견된 sync 설정 ENOENT 버그 hotfix.
|
||||
|
||||
### 수정
|
||||
|
||||
- **Sync 설정 첫 저장 실패 (git init ENOENT)**: 설정 → 동기화 저장소에서 URL 입력 후 "저장" 클릭 시 `git init failed: fatal: cannot change to '<profileDir>/sync': No such file or directory` 로 실패하던 문제. `settings:configure-sync` IPC 핸들러가 `git -C <syncDir> init` 호출 전에 syncDir 디렉토리를 생성하지 않아 git 이 chdir 단계에서 죽음. `SyncService.runSync()` 의 동일 패턴 (`mkdir(syncDir, { recursive: true })`) 을 핸들러에도 추가. 결과적으로 "연결 테스트" 버튼이 영영 활성화되지 않던 연쇄 증상 (저장 성공 시에만 url state 채워지고 버튼 enable) 도 자동 해소.
|
||||
|
||||
### 게이트
|
||||
|
||||
- 단위 테스트: `tests/unit/sync-ipc.test.ts` 18 (mkdir 호출 순서 회귀 1 추가)
|
||||
- typecheck: 0 errors
|
||||
- 신규 npm dependency: 0
|
||||
|
||||
### 업그레이드
|
||||
|
||||
v0.3.2 인스톨러 위에 v0.3.3 인스톨러를 같은 위치에 실행하면 in-place 업그레이드. 데이터/마이그레이션 변경 없음 (스키마 v8 그대로).
|
||||
|
||||
## [0.2.2] — 2026-04-26
|
||||
|
||||
v0.2.1 dogfood 중 발견된 F7 (Due Date 합성 표현) + Quick Capture 스크롤 버그를 묶은 패치.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "inkling",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"private": true,
|
||||
"description": "Inkling — local-first 한 줄 보관 도구",
|
||||
"author": "altair823 <dlsrks0734@gmail.com>",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import electron from 'electron';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import { platform, release, EOL } from 'node:os';
|
||||
import { mkdir } from 'node:fs/promises';
|
||||
const { ipcMain, app, dialog, Notification, shell, clipboard } = electron;
|
||||
import { logger } from '../logger.js';
|
||||
import type { BackupService } from '../services/BackupService.js';
|
||||
@@ -324,6 +325,11 @@ export function registerSettingsApi(deps?: SettingsIpcDeps): void {
|
||||
|
||||
// git init + remote add origin
|
||||
const syncDir = deps.syncSvc.getSyncDir();
|
||||
try {
|
||||
await mkdir(syncDir, { recursive: true });
|
||||
} catch (e) {
|
||||
return { ok: false as const, reason: `mkdir failed: ${(e as Error).message}` };
|
||||
}
|
||||
const git = new GitClient(syncDir);
|
||||
|
||||
if (!(await git.isRepo())) {
|
||||
|
||||
@@ -2,8 +2,10 @@ import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
|
||||
vi.mock('electron', () => ({ default: { ipcMain: { handle: vi.fn() }, dialog: {}, shell: {} } }));
|
||||
vi.mock('../../src/main/services/GitClient.js');
|
||||
vi.mock('node:fs/promises', () => ({ mkdir: vi.fn(async () => undefined) }));
|
||||
|
||||
import electron from 'electron';
|
||||
import { mkdir } from 'node:fs/promises';
|
||||
import { GitClient } from '../../src/main/services/GitClient.js';
|
||||
import { registerSettingsApi } from '../../src/main/ipc/settingsApi.js';
|
||||
import type { SettingsIpcDeps } from '../../src/main/ipc/settingsApi.js';
|
||||
@@ -105,6 +107,25 @@ describe('sync IPC channels', () => {
|
||||
expect(r).toEqual({ ok: true });
|
||||
});
|
||||
|
||||
// Regression: syncDir 미생성 상태에서 `git -C <syncDir> init` 호출 시
|
||||
// git 이 chdir 실패로 죽음 → mkdir(recursive) 가 init 보다 먼저 호출되어야 함.
|
||||
// (runSync 의 line 135 패턴과 동일.)
|
||||
it('mkdir(syncDir, recursive) 가 git init 전에 호출됨', async () => {
|
||||
const { deps, gitInstance } = makeDeps();
|
||||
gitInstance.isRepo.mockResolvedValue(false);
|
||||
const callOrder: string[] = [];
|
||||
(mkdir as unknown as ReturnType<typeof vi.fn>).mockImplementationOnce(async () => { callOrder.push('mkdir'); });
|
||||
(gitInstance.run as unknown as ReturnType<typeof vi.fn>).mockImplementation(async (args: string[]) => {
|
||||
callOrder.push(`git:${args[0]}`);
|
||||
return { stdout: '', stderr: '', exitCode: 0 };
|
||||
});
|
||||
registerSettingsApi(deps as SettingsIpcDeps);
|
||||
const h = getHandler('settings:configure-sync');
|
||||
await h({}, 'git@github.com:user/repo.git');
|
||||
expect(mkdir).toHaveBeenCalledWith('/tmp/sync', { recursive: true });
|
||||
expect(callOrder.indexOf('mkdir')).toBeLessThan(callOrder.indexOf('git:init'));
|
||||
});
|
||||
|
||||
it('valid URL → isRepo=true, hasRemote=true → remote set-url', async () => {
|
||||
const { deps, gitInstance } = makeDeps();
|
||||
gitInstance.isRepo.mockResolvedValue(true);
|
||||
|
||||
Reference in New Issue
Block a user