From 1c118286773e02c7f51e8dab781fdec4f4d6ce0d Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 30 Jun 2022 10:27:20 +0100 Subject: [PATCH] Merge pull request #8649 from overleaf/jpa-halt-on-error-flag [web] record stopOnFirstError in compile-result-backend event GitOrigin-RevId: f194daa1cb377e095acf7a280ff5ba7859b8736b --- services/web/app/src/Features/Compile/CompileController.js | 6 +++--- .../web/test/unit/src/Compile/CompileControllerTests.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/Compile/CompileController.js b/services/web/app/src/Features/Compile/CompileController.js index bc2a194104..43a2950a60 100644 --- a/services/web/app/src/Features/Compile/CompileController.js +++ b/services/web/app/src/Features/Compile/CompileController.js @@ -32,11 +32,13 @@ module.exports = CompileController = { const isAutoCompile = !!req.query.auto_compile const enablePdfCaching = !!req.query.enable_pdf_caching const fileLineErrors = !!req.query.file_line_errors + const stopOnFirstError = !!req.body.stopOnFirstError const userId = SessionManager.getLoggedInUserId(req.session) const options = { isAutoCompile, enablePdfCaching, fileLineErrors, + stopOnFirstError, } if (req.body.rootDoc_id) { @@ -54,9 +56,6 @@ module.exports = CompileController = { if (req.body.draft) { options.draft = req.body.draft } - if (req.body.stopOnFirstError) { - options.stopOnFirstError = req.body.stopOnFirstError - } if (['validate', 'error', 'silent'].includes(req.body.check)) { options.check = req.body.check } @@ -105,6 +104,7 @@ module.exports = CompileController = { timeout: limits.timeout === 60 ? 'short' : 'long', server: clsiServerId?.includes('-c2d-') ? 'faster' : 'normal', isAutoCompile, + stopOnFirstError, } ) } diff --git a/services/web/test/unit/src/Compile/CompileControllerTests.js b/services/web/test/unit/src/Compile/CompileControllerTests.js index 1fa97a0105..b8449ed9a3 100644 --- a/services/web/test/unit/src/Compile/CompileControllerTests.js +++ b/services/web/test/unit/src/Compile/CompileControllerTests.js @@ -178,6 +178,7 @@ describe('CompileController', function () { isAutoCompile: false, enablePdfCaching: false, fileLineErrors: false, + stopOnFirstError: false, }) .should.equal(true) }) @@ -209,6 +210,7 @@ describe('CompileController', function () { isAutoCompile: true, enablePdfCaching: false, fileLineErrors: false, + stopOnFirstError: false, }) .should.equal(true) }) @@ -227,6 +229,7 @@ describe('CompileController', function () { enablePdfCaching: false, draft: true, fileLineErrors: false, + stopOnFirstError: false, }) .should.equal(true) })