fix: read stored project compiler for quartoFlavor update
Build and Deploy Verso / deploy (push) Successful in 20m28s

options.compiler is set from req.body.compiler which the frontend never
sends, so the condition was never true and quartoFlavor was never written.
Use ProjectGetter to read the stored compiler instead. Fire-and-forget so
it does not delay the compile response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
claude
2026-06-10 08:48:25 +00:00
parent 2c8dad08f6
commit e6773c6baf
@@ -303,14 +303,22 @@ const _CompileController = {
// Persist quarto output flavor so the project-list badge can distinguish // Persist quarto output flavor so the project-list badge can distinguish
// RevealJS presentations from PDF documents without needing a compile. // RevealJS presentations from PDF documents without needing a compile.
if (status === 'success' && options.compiler === 'quarto') { // options.compiler is not sent by the frontend, so we read the stored
// compiler from the DB. Done fire-and-forget so it never delays the response.
if (status === 'success') {
const isHtml = outputFiles.some(f => f.path === 'output.html') const isHtml = outputFiles.some(f => f.path === 'output.html')
Project.updateOne( ProjectGetter.promises
{ _id: projectId }, .getProject(projectId, { compiler: 1 })
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' } .then(project => {
).exec().catch(err => if (project?.compiler !== 'quarto') return
logger.warn({ err, projectId }, 'failed to update quartoFlavor') return Project.updateOne(
) { _id: projectId },
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' }
).exec()
})
.catch(err =>
logger.warn({ err, projectId }, 'failed to update quartoFlavor')
)
} }
res.json({ res.json({