diff options
| author | haoyuren <13851610112@163.com> | 2026-03-15 01:57:17 -0500 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-03-15 01:57:17 -0500 |
| commit | 7748999a8b0c3ab5e7b107bf7c42f24580cb23aa (patch) | |
| tree | 44d897792cab654ed577e8324794b764a1536c70 /src/main/overleafSocket.ts | |
| parent | 99c663cdc9dc1ae23cec244bf7b0d79a16a62808 (diff) | |
Real-time comment sync, MCP server expansion, multi-tab terminal, UI fixes
- Fix Socket.IO v0.9 ack parser to handle acks without data (6:::N format),
fixing comment creation stuck at "sending"
- Rewrite comment sync to use local state updates from socket events
(new-comment, resolve-thread, reopen-thread, delete-thread, edit-message,
delete-message) instead of REST re-fetches — instant UI updates
- Optimistic updates for all comment actions (resolve, reopen, delete, reply, edit)
- Fetch threads + contexts on project connect so editor highlights are correct
from startup, not only when review panel is opened
- Add comment context to store immediately after creation for instant highlight
- Rename MCP server from overleaf-comments to lattex, add 6 new tools:
reopen_comment, delete_comment, get_chat_messages, send_chat_message,
list_project_files, compile_latex — all auto-granted permissions
- Refactor terminal from fixed Terminal/Claude tabs to dynamic multi-tab with
bottom tab bar and unlimited new terminal creation
- Fix chat panel layout overflow pushing other components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/main/overleafSocket.ts')
| -rw-r--r-- | src/main/overleafSocket.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/overleafSocket.ts b/src/main/overleafSocket.ts index 195eb05..96d9138 100644 --- a/src/main/overleafSocket.ts +++ b/src/main/overleafSocket.ts @@ -301,11 +301,8 @@ export class OverleafSocket extends EventEmitter { this.joinedDocs.delete(docId) } - async applyOtUpdate(docId: string, ops: unknown[], version: number, hash: string): Promise<void> { - // Use emitWithAck so the server's callback response comes back as a Socket.IO ack - // Do NOT send hash — Overleaf's document-updater hash check causes disconnect + rollback on mismatch - const result = await this.emitWithAck('applyOtUpdate', [docId, { doc: docId, op: ops, v: version }]) - if (result) console.log(`[applyOtUpdate] ack for ${docId} v=${version}`) + async applyOtUpdate(docId: string, ops: unknown[], version: number, hash?: string): Promise<void> { + await this.emitWithAck('applyOtUpdate', [docId, { doc: docId, op: ops, v: version }]) } /** Get list of connected users with their cursor positions */ |
