Răsfoiți Sursa

Merge pull request #8649 from overleaf/jpa-halt-on-error-flag

[web] record stopOnFirstError in compile-result-backend event

GitOrigin-RevId: f194daa1cb377e095acf7a280ff5ba7859b8736b
Jakob Ackermann 4 ani în urmă
părinte
comite
3b84710d75

+ 3 - 3
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,
             }
           )
         }

+ 3 - 0
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)
       })