From 9dd965da3c82beb453d73598cd05ee426408f00b Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Wed, 10 Oct 2018 15:04:18 +0100 Subject: [PATCH 1/2] Prevent autocompile loop If an autocompile hits a rate limit, it would get into a bad state where it would continuely loop making compile requests. This is because the compile response resolving would disable auto compile (because the rate limit was hit) but also trigger calculation of uncompiled changes, which would not check if autocompile was disabled. The fix is to just check if autocompile is disabled. --- .../web/public/coffee/ide/pdf/controllers/PdfController.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 001178c5dd..acd6b4e349 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -125,6 +125,9 @@ define [ $scope.uncompiledChanges = false recalculateUncompiledChanges = () -> + if !$scope.autocompile_enabled + # Auto-compile was disabled + $scope.uncompiledChanges = false if $scope.ui.pdfHidden # Don't bother auto-compiling if pdf isn't visible $scope.uncompiledChanges = false From 96d7d83b90b2da6fb22ee56cc4c3d4c3ab84d286 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 11 Oct 2018 09:30:21 +0100 Subject: [PATCH 2/2] Add guard against autocompile being disabled --- .../web/public/coffee/ide/pdf/controllers/PdfController.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index acd6b4e349..040d536b48 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -71,7 +71,7 @@ define [ autoCompileInterval = null autoCompileIfReady = () -> - if $scope.pdf.compiling + if $scope.pdf.compiling or !$scope.autocompile_enabled return # Only checking linting if syntaxValidation is on and visible to the user