CrownyDoc 약점 #78 #79 수정 — 버전 영속화 + CRDT 충돌 해결
개요
CrownyDoc Office Suite 벤치마크 약점 중 마지막 CRITICAL(#78)과 HIGH(#79)를 구현했다.
CRITICAL 약점 0건 달성. 완료 43건 / 미완 57건(CRITICAL 0, HIGH 9).
무엇을 했는지
#78 서버 버전 영속화 (CRITICAL → done)
CrownyVersionStore 객체 구현
- IndexedDB 기반 영속 저장 (
crowny-versions DB, versions store)
- auto-increment key + docId 인덱스 + docId+version 복합 유니크 인덱스
- 메서드:
save, getVersions, getVersion, deleteOldVersions, exportVersions, importVersions, _openDB, _checksum
- DJB2 해시 체크섬으로 무결성 검증
- 버전 목록 조회 시 content 제외 (용량 절약)
#79 CRDT/OT 충돌 해결 (HIGH → done)
CrownyCRDT 객체 구현 — 간이 OT (Operational Transformation)
- 연산 타입:
insert(pos, text) / delete(pos, len)
transform(op1, op2): 4가지 케이스 처리 (insert/insert, insert/delete, delete/insert, delete/delete)
apply(doc, op): 문서에 연산 직접 적용
merge(doc, localOps, remoteOps): 원격 연산을 로컬 기준으로 변환 후 적용
_detectConflict(op1, op2): 충돌 감지
showConflictDialog(conflicts): 충돌 시 사용자 선택 UI — "내 변경 유지" / "상대방 변경 적용" / "둘 다 유지"
관련 파일 경로
- JS:
/Users/ef/CrownyDoc/한선씨/정적/version-store.js
- 한선씨 동반:
/Users/ef/CrownyDoc/한선씨/협업/버전CRDT.한선
- 상태 JSON:
/Users/ef/CrownyDoc/benchmark-weaknesses.json
잔여 이슈
- 한선씨 파일 컴파일 검증 필요 (
cd /Users/ef/CrownyOS/crownyc && ./hanseonc_high .../버전CRDT.한선)
showConflictDialog의 _resolveConflict 콜백을 editor-core.js와 연동 필요
CrownyVersionStore.save()를 문서 저장 시 자동 호출하도록 editor-core.js 훅 연결 필요
- HIGH 약점 9건 잔존