v1.3.7: 기록 관리(경기 · 경기 전후 대화 묶음, 한 번에 지우기 · zip 내보내기/받아오기) · 검토로 찾은 오류 고침
- 기록 묶음 API · zip 형식(gvr-bundle v1) · 받아오기 검사(꼭 필요한 내용이 없으면 실패, 아무것도 넣지 않음) - 사이트 기록 탭, 큰 zip 조각 중계 - 관리자 확인 %인코딩 우회, 큰 전송 중 연결 끊김, 진행 중 경기 지우기, 예전 녹음 고치기 덮어쓰기, 타임라인 끼워 넣기, 숫자 반복 줄이기, TTS 반쪽 파일 등 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -94,7 +94,7 @@ test('기록 묶음: zip 내보내기 → 지우기 → 받아오기로 그대
|
||||
assert.equal(b.list().length, 1);
|
||||
// 받아오기
|
||||
const imp = b.import(zip);
|
||||
assert.equal(imp.added.utterances, 6);
|
||||
assert.equal(imp.added.utterances, 5, '잡음 발화는 내보내지 않는다');
|
||||
assert.equal(imp.added.matches, 1);
|
||||
assert.equal(imp.added.events, 1);
|
||||
assert.equal(imp.skipped, 0);
|
||||
@@ -103,7 +103,7 @@ test('기록 묶음: zip 내보내기 → 지우기 → 받아오기로 그대
|
||||
assert.ok(fs.existsSync(store.getUtterance('in1')!.audio_path!));
|
||||
assert.equal(store.rounds('val-1').length, 1);
|
||||
// 같은 zip 을 또 받으면 건너뛴다
|
||||
assert.equal(b.import(zip).skipped, 6);
|
||||
assert.equal(b.import(zip).skipped, 5);
|
||||
// 받아온 녹음은 보관 기간을 받아온 날부터 센다 (녹음 날짜가 오래돼도 바로 지우지 않음)
|
||||
const ret = new Retention(store, () => 7, () => audio).run(Date.now());
|
||||
assert.equal(ret.deleted, 1, '받아오지 않은 다른 날 발화만 지운다');
|
||||
@@ -111,6 +111,16 @@ test('기록 묶음: zip 내보내기 → 지우기 → 받아오기로 그대
|
||||
store.close();
|
||||
});
|
||||
|
||||
test('기록 묶음: 진행 중인 경기는 지우지 않는다', () => {
|
||||
const { store, b } = seed(tmp());
|
||||
store.db.prepare(`UPDATE matches SET status='live' WHERE id='val-1'`).run();
|
||||
const m = b.list().find((x) => x.kind === 'match')!;
|
||||
assert.equal(m.live, true);
|
||||
assert.throws(() => b.delete([m.id]), (e: any) => e instanceof BundleError && e.code === 'busy');
|
||||
assert.ok(store.getMatch('val-1'));
|
||||
store.close();
|
||||
});
|
||||
|
||||
test('기록 묶음: 다른 프로그램으로 다시 압축한(deflate) zip 도 받는다', () => {
|
||||
const dir = tmp();
|
||||
const { store, b } = seed(dir);
|
||||
|
||||
@@ -96,6 +96,10 @@ test('E2E: 발화 → STT 워커 → DB → 실시간 이벤트 → 기록 API',
|
||||
const ex = await core.api.inject({ method: 'GET', url: `/api/bundles/export?ids=${bl[0].id}` });
|
||||
assert.equal(ex.headers['content-type'], 'application/zip');
|
||||
assert.match(String(ex.headers['content-disposition']), /attachment; filename="gvr-talk-\d{8}-\d{4}\.zip"/);
|
||||
// 사이트 중계로 온 요청은 사이트 서버가 붙인 역할이 관리자여야 한다
|
||||
const user = encodeURIComponent(JSON.stringify({ id: 'm1', name: 'x', avatar: null }));
|
||||
assert.equal((await core.api.inject({ method: 'POST', url: '/api/bundles/delete', headers: { 'x-gvr-user': user, 'x-gvr-role': 'member' }, payload: { ids: [bl[0].id] } })).statusCode, 403);
|
||||
assert.equal((await core.api.inject({ method: 'POST', url: '/api/bundles/delete', headers: { 'x-gvr-user': user }, payload: { ids: [bl[0].id] } })).statusCode, 403);
|
||||
const del = (await core.api.inject({ method: 'POST', url: '/api/bundles/delete', payload: { ids: [bl[0].id] } })).json();
|
||||
assert.equal(del.utterances, 3);
|
||||
assert.equal((await core.api.inject({ method: 'GET', url: '/api/timeline' })).json().items.length, 0);
|
||||
@@ -103,7 +107,7 @@ test('E2E: 발화 → STT 워커 → DB → 실시간 이벤트 → 기록 API',
|
||||
assert.equal(bad.statusCode, 400);
|
||||
assert.match(bad.json().message, /^받아오기 실패/);
|
||||
const imp = (await core.api.inject({ method: 'POST', url: '/api/bundles/import', headers: { 'content-type': 'application/zip' }, payload: ex.rawPayload })).json();
|
||||
assert.equal(imp.added.utterances, 3);
|
||||
assert.equal(imp.added.utterances, 2, '잡음(keys)은 내보내지 않는다');
|
||||
assert.equal((await core.api.inject({ method: 'GET', url: '/api/timeline' })).json().items.length, 2);
|
||||
assert.ok(live.some((e) => e.type === 'records.changed'));
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user