fix(git-sync): don't require clsiServerId to push PDF

In single-server CE deployments (Verso included) the CLSI does not
return a clsiServerId, so it was always undefined. The push condition
checked pdfPath && pdfBuildId && pdfClsiServerId && userId, meaning the
PDF was silently skipped every time in practice.

clsiServerId is optional in getOutputFileURL (single-server deployments
work without it), so only require pdfPath and pdfBuildId. Also remove
the inner try/catch so PDF fetch errors surface to the user instead of
being swallowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
claude
2026-06-23 23:17:39 +00:00
parent 8ea6f6ecb1
commit 9a474f7790
@@ -114,22 +114,19 @@ async function pushToRemote(
}
// Optionally include the compiled PDF at a configured path
if (pdfPath && pdfBuildId && pdfClsiServerId && userId) {
try {
const pdfStream = await ClsiManager.promises.getOutputFileStream(
projectId,
userId,
pdfClsiServerId,
pdfBuildId,
'output.pdf'
)
const pdfDest = join(fileRoot, pdfPath)
await mkdir(dirname(pdfDest), { recursive: true })
await pipeline(pdfStream, createWriteStream(pdfDest))
logger.debug({ projectId }, 'git sync: PDF included')
} catch (err) {
logger.warn({ err, projectId }, 'git sync: could not fetch PDF, skipping')
}
// clsiServerId is optional (absent in single-server CE deployments)
if (pdfPath && pdfBuildId) {
const pdfStream = await ClsiManager.promises.getOutputFileStream(
projectId,
userId,
pdfClsiServerId ?? null,
pdfBuildId,
'output.pdf'
)
const pdfDest = join(fileRoot, pdfPath)
await mkdir(dirname(pdfDest), { recursive: true })
await pipeline(pdfStream, createWriteStream(pdfDest))
logger.debug({ projectId }, 'git sync: PDF included')
}
// Git operations — force-push a single commit so the remote always