summaryrefslogtreecommitdiff
path: root/src/main/fileSyncBridge.ts
AgeCommit message (Collapse)Author
9 hoursFix Claude Code → Overleaf sync: remove hash from applyOtUpdate, fix OT bugshaoyuren
Root cause: SHA-1 hash sent with applyOtUpdate didn't match Overleaf's server-side computation, causing "Invalid hash" error, disconnect, and rollback of all synced changes. - Remove hash field from applyOtUpdate to skip server-side hash check - Switch applyOtUpdate from fire-and-forget to emitWithAck for reliable ack - Fix getOldDoc bug: save base doc when changes start accumulating instead of incorrectly using current doc (caused wrong delete ops) - Fix ack handler: only ack when no 'op' field (was acking remote ops too) - Await fileSyncBridge.start() instead of fire-and-forget - Add joinDoc retry logic for transient joinLeaveEpoch mismatch errors - Clear pending ack callbacks on WebSocket close to prevent timeout errors - Add otUpdateError logging for server-side rejections - Add file-based bridge logging for debugging sync issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 hoursUse polling for file watcher to reliably detect external editshaoyuren
chokidar FSEvents is unreliable in macOS temp dirs and misses atomic writes (write temp + rename) used by Claude Code and other editors. Switch to usePolling with 500ms interval and atomic: true. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 hoursAdd bidirectional sync for binary files (PDF, images, etc.)haoyuren
FileSyncBridge now handles binary fileRefs in addition to text docs: - Downloads all binary files to temp dir on project connect - Watches for binary file changes on disk and uploads via REST API - Listens for Overleaf socket events (reciveNewFile, reciveNewDoc, removeEntity, reciveEntityRename) to sync remote changes to disk - Tracks binary files by SHA1 hash to avoid redundant uploads Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 hoursAdd AGPL-3.0 license and copyright headers to all source fileshaoyuren
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 hoursAdd bidirectional file sync, OT system, comments, and real-time collaborationhaoyuren
Implement full Overleaf integration with Socket.IO v0.9 real-time sync: - FileSyncBridge for bidirectional temp dir ↔ Overleaf sync via chokidar + diff-match-patch - OT state machine, transform functions, and CM6 adapter for collaborative editing - Comment system with highlights, tooltips, and review panel - Project list, file tree management, and socket-based compilation - 3-layer loop prevention (write guards, content equality, debounce) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>