From 183af193dcf46838506958a50daad61c6b29a23d Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 15 Mar 2026 04:00:12 -0500 Subject: Fix server compile: download PDF to .build dir, prevent artifact sync to Overleaf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root cause of server compile failures was that output.pdf was being saved into the synced project directory, causing FileSyncBridge to upload it back to Overleaf as a project file. CLSI then failed because it found an existing output.pdf blocking its compilation output. Changes: - Save compile artifacts (PDF, synctex.gz) to .build/ subdirectory instead of the synced project root — .build is a dotfile dir ignored by chokidar - Add pdf/pdfxref/stderr/stdout/chktex to FileSyncBridge ignore patterns - Add rootResourcePath to compile request body (matches Overleaf web client) - Implement PDF download with fallback via direct build ID URL construction - Add server compile handler, compile dropdown menu, PDF save button - Fix resolved comment highlight flash on startup (null initial state) - Fix EPIPE crash on startup when stdout/stderr is closed - Fix synctex inverse search to use relative paths via OT doc join Co-Authored-By: Claude Opus 4.6 --- src/main/fileSyncBridge.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/fileSyncBridge.ts') diff --git a/src/main/fileSyncBridge.ts b/src/main/fileSyncBridge.ts index 7763521..fb45208 100644 --- a/src/main/fileSyncBridge.ts +++ b/src/main/fileSyncBridge.ts @@ -138,7 +138,7 @@ export class FileSyncBridge { atomic: true, ignored: [ /(^|[/\\])\../, // dotfiles - /\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb)$/ // LaTeX output files (not pdf!) + /\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb|pdf|pdfxref|stderr|stdout|chktex)$/ // LaTeX output files ] }) @@ -832,7 +832,7 @@ export class FileSyncBridge { for (const relPath of allFiles) { if (this.pathDocMap[relPath] || this.pathFileRefMap[relPath]) continue // Skip LaTeX output files - if (/\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb|pdf|synctex)/.test(relPath)) continue + if (/\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb|pdf|pdfxref|stderr|stdout|chktex|synctex)/.test(relPath)) continue if (/(^|[/\\])\./.test(relPath)) continue bridgeLog(`[FileSyncBridge] orphaned file found: ${relPath}`) @@ -851,7 +851,7 @@ export class FileSyncBridge { if (this.writesInProgress.has(relPath)) return // Skip LaTeX output files and dotfiles (same as chokidar ignored) - if (/\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb)$/.test(relPath)) return + if (/\.(aux|log|fls|fdb_latexmk|synctex\.gz|bbl|blg|out|toc|lof|lot|nav|snm|vrb|pdf|pdfxref|stderr|stdout|chktex)$/.test(relPath)) return if (/(^|[/\\])\./.test(relPath)) return // Debounce 1s to let the tool finish writing -- cgit v1.2.3