summaryrefslogtreecommitdiff
path: root/src/main/otClient.ts
AgeCommit message (Collapse)Author
3 daysFix Overleaf file tree sync updateshaoyuren
2026-03-18Fix OT sync corruption: match Overleaf ShareJS ack/echo handlinghaoyuren
The server broadcasts otUpdateApplied (with ops) to ALL clients including the sender. Our bridge was treating its own echoed ops as remote ops and re-applying them, causing text duplication (e.g. "simulatorimulator"). Rewrite OT handling to match Overleaf's ShareJS _onMessage pattern: - ACK = no ops OR meta.source matches our publicId (own echo) - REMOTE = ops from a different source - ACK path calls onAck() without re-applying ops - OtClient silently drops duplicate acks in synchronized state - OtClient drops stale remote ops (version < current) - Remove pendingEchos counter in favor of meta.source detection Also: refresh MCP comment contexts on new-comment/delete-thread events, add Overleaf reference repo to .gitignore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13Add AGPL-3.0 license and copyright headers to all source fileshaoyuren
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12Add 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>