فهرست منبع

Update logger, metrics, and redis

Also fix acceptance tests, broken by a change in the redis driver
behaviour. It now returns promises from most operations, which confuses mocha.
Shane Kilkelly 7 سال پیش
والد
کامیت
080b482e51

+ 1 - 1
services/document-updater/Jenkinsfile

@@ -5,7 +5,7 @@ pipeline {
 
 
   environment {
   environment {
     GIT_PROJECT = "document-updater"
     GIT_PROJECT = "document-updater"
-    JENKINS_WORKFLOW = "document-updater-sharelatex-internal"
+    JENKINS_WORKFLOW = "document-updater-sharelatex"
     TARGET_URL = "${env.JENKINS_URL}blue/organizations/jenkins/${JENKINS_WORKFLOW}/detail/$BRANCH_NAME/$BUILD_NUMBER/pipeline"
     TARGET_URL = "${env.JENKINS_URL}blue/organizations/jenkins/${JENKINS_WORKFLOW}/detail/$BRANCH_NAME/$BUILD_NUMBER/pipeline"
     GIT_API_URL = "https://api.github.com/repos/overleaf/${GIT_PROJECT}/statuses/$GIT_COMMIT"
     GIT_API_URL = "https://api.github.com/repos/overleaf/${GIT_PROJECT}/statuses/$GIT_COMMIT"
   }
   }

+ 4 - 2
services/document-updater/Makefile

@@ -1,7 +1,7 @@
 # This file was auto-generated, do not edit it directly.
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.1.12
+# Version: 1.1.21
 
 
 BUILD_NUMBER ?= local
 BUILD_NUMBER ?= local
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
 BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
@@ -26,7 +26,9 @@ test: test_unit test_acceptance
 test_unit:
 test_unit:
 	@[ ! -d test/unit ] && echo "document-updater has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit
 	@[ ! -d test/unit ] && echo "document-updater has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit
 
 
-test_acceptance: test_clean test_acceptance_pre_run # clear the database before each acceptance test run
+test_acceptance: test_clean test_acceptance_pre_run test_acceptance_run
+
+test_acceptance_run:
 	@[ ! -d test/acceptance ] && echo "document-updater has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance
 	@[ ! -d test/acceptance ] && echo "document-updater has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance
 
 
 test_clean:
 test_clean:

+ 1 - 1
services/document-updater/buildscript.txt

@@ -5,4 +5,4 @@ document-updater
 --dependencies=mongo,redis
 --dependencies=mongo,redis
 --docker-repos=gcr.io/overleaf-ops
 --docker-repos=gcr.io/overleaf-ops
 --build-target=docker
 --build-target=docker
---script-version=1.1.12
+--script-version=1.1.21

+ 4 - 1
services/document-updater/docker-compose.ci.yml

@@ -1,7 +1,7 @@
 # This file was auto-generated, do not edit it directly.
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.1.12
+# Version: 1.1.21
 
 
 version: "2"
 version: "2"
 
 
@@ -10,6 +10,8 @@ services:
     image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
     image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
     user: node
     user: node
     command: npm run test:unit:_run
     command: npm run test:unit:_run
+    environment:
+      NODE_ENV: test
 
 
 
 
   test_acceptance:
   test_acceptance:
@@ -21,6 +23,7 @@ services:
       MONGO_HOST: mongo
       MONGO_HOST: mongo
       POSTGRES_HOST: postgres
       POSTGRES_HOST: postgres
       MOCHA_GREP: ${MOCHA_GREP}
       MOCHA_GREP: ${MOCHA_GREP}
+      NODE_ENV: test
     depends_on:
     depends_on:
       - mongo
       - mongo
       - redis
       - redis

+ 6 - 2
services/document-updater/docker-compose.yml

@@ -1,18 +1,19 @@
 # This file was auto-generated, do not edit it directly.
 # This file was auto-generated, do not edit it directly.
 # Instead run bin/update_build_scripts from
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 # https://github.com/sharelatex/sharelatex-dev-environment
-# Version: 1.1.12
+# Version: 1.1.21
 
 
 version: "2"
 version: "2"
 
 
 services:
 services:
   test_unit:
   test_unit:
-    build: .
+    image: node:6.9.5
     volumes:
     volumes:
       - .:/app
       - .:/app
     working_dir: /app
     working_dir: /app
     environment:
     environment:
       MOCHA_GREP: ${MOCHA_GREP}
       MOCHA_GREP: ${MOCHA_GREP}
+      NODE_ENV: test
     command: npm run test:unit
     command: npm run test:unit
     user: node
     user: node
 
 
@@ -27,6 +28,8 @@ services:
       MONGO_HOST: mongo
       MONGO_HOST: mongo
       POSTGRES_HOST: postgres
       POSTGRES_HOST: postgres
       MOCHA_GREP: ${MOCHA_GREP}
       MOCHA_GREP: ${MOCHA_GREP}
+      LOG_LEVEL: ERROR
+      NODE_ENV: test
     user: node
     user: node
     depends_on:
     depends_on:
       - mongo
       - mongo
@@ -49,3 +52,4 @@ services:
   mongo:
   mongo:
     image: mongo:3.4
     image: mongo:3.4
 
 
+

+ 223 - 183
services/document-updater/npm-shrinkwrap.json

@@ -3,19 +3,31 @@
   "version": "0.1.4",
   "version": "0.1.4",
   "dependencies": {
   "dependencies": {
     "@google-cloud/common": {
     "@google-cloud/common": {
-      "version": "0.27.0",
-      "from": "@google-cloud/common@>=0.27.0 <0.28.0",
-      "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.27.0.tgz"
+      "version": "0.32.1",
+      "from": "@google-cloud/common@>=0.32.0 <0.33.0",
+      "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.32.1.tgz",
+      "dependencies": {
+        "extend": {
+          "version": "3.0.2",
+          "from": "extend@>=3.0.2 <4.0.0",
+          "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
+        }
+      }
     },
     },
     "@google-cloud/debug-agent": {
     "@google-cloud/debug-agent": {
-      "version": "3.0.1",
+      "version": "3.2.0",
       "from": "@google-cloud/debug-agent@>=3.0.0 <4.0.0",
       "from": "@google-cloud/debug-agent@>=3.0.0 <4.0.0",
-      "resolved": "https://registry.npmjs.org/@google-cloud/debug-agent/-/debug-agent-3.0.1.tgz",
+      "resolved": "https://registry.npmjs.org/@google-cloud/debug-agent/-/debug-agent-3.2.0.tgz",
       "dependencies": {
       "dependencies": {
         "coffeescript": {
         "coffeescript": {
-          "version": "2.3.2",
+          "version": "2.4.1",
           "from": "coffeescript@>=2.0.0 <3.0.0",
           "from": "coffeescript@>=2.0.0 <3.0.0",
-          "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.3.2.tgz"
+          "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.4.1.tgz"
+        },
+        "semver": {
+          "version": "6.1.1",
+          "from": "semver@>=6.0.0 <7.0.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz"
         }
         }
       }
       }
     },
     },
@@ -29,43 +41,65 @@
           "from": "@google-cloud/common@>=0.26.0 <0.27.0",
           "from": "@google-cloud/common@>=0.26.0 <0.27.0",
           "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.26.2.tgz"
           "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.26.2.tgz"
         },
         },
+        "@google-cloud/promisify": {
+          "version": "0.3.1",
+          "from": "@google-cloud/promisify@>=0.3.0 <0.4.0",
+          "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.3.1.tgz"
+        },
+        "arrify": {
+          "version": "1.0.1",
+          "from": "arrify@>=1.0.1 <2.0.0",
+          "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz"
+        },
+        "gcp-metadata": {
+          "version": "0.9.3",
+          "from": "gcp-metadata@>=0.9.0 <0.10.0",
+          "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.9.3.tgz"
+        },
+        "google-auth-library": {
+          "version": "2.0.2",
+          "from": "google-auth-library@>=2.0.0 <3.0.0",
+          "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-2.0.2.tgz",
+          "dependencies": {
+            "gcp-metadata": {
+              "version": "0.7.0",
+              "from": "gcp-metadata@>=0.7.0 <0.8.0",
+              "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.7.0.tgz"
+            }
+          }
+        },
         "through2": {
         "through2": {
-          "version": "3.0.0",
+          "version": "3.0.1",
           "from": "through2@>=3.0.0 <4.0.0",
           "from": "through2@>=3.0.0 <4.0.0",
-          "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz"
+          "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz"
         }
         }
       }
       }
     },
     },
     "@google-cloud/projectify": {
     "@google-cloud/projectify": {
-      "version": "0.3.2",
-      "from": "@google-cloud/projectify@>=0.3.0 <0.4.0",
-      "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.2.tgz"
+      "version": "0.3.3",
+      "from": "@google-cloud/projectify@>=0.3.3 <0.4.0",
+      "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.3.tgz"
     },
     },
     "@google-cloud/promisify": {
     "@google-cloud/promisify": {
-      "version": "0.3.1",
-      "from": "@google-cloud/promisify@>=0.3.0 <0.4.0",
-      "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.3.1.tgz"
+      "version": "0.4.0",
+      "from": "@google-cloud/promisify@>=0.4.0 <0.5.0",
+      "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz"
     },
     },
     "@google-cloud/trace-agent": {
     "@google-cloud/trace-agent": {
-      "version": "3.5.2",
+      "version": "3.6.1",
       "from": "@google-cloud/trace-agent@>=3.2.0 <4.0.0",
       "from": "@google-cloud/trace-agent@>=3.2.0 <4.0.0",
-      "resolved": "https://registry.npmjs.org/@google-cloud/trace-agent/-/trace-agent-3.5.2.tgz",
+      "resolved": "https://registry.npmjs.org/@google-cloud/trace-agent/-/trace-agent-3.6.1.tgz",
       "dependencies": {
       "dependencies": {
-        "@google-cloud/common": {
-          "version": "0.30.2",
-          "from": "@google-cloud/common@>=0.30.0 <0.31.0",
-          "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.30.2.tgz"
-        },
-        "google-auth-library": {
-          "version": "3.0.1",
-          "from": "google-auth-library@>=3.0.0 <4.0.0",
-          "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz"
-        },
         "methods": {
         "methods": {
           "version": "1.1.2",
           "version": "1.1.2",
           "from": "methods@>=1.1.1 <2.0.0",
           "from": "methods@>=1.1.1 <2.0.0",
           "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz"
           "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz"
         },
         },
+        "semver": {
+          "version": "6.1.1",
+          "from": "semver@^6.0.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz"
+        },
         "uuid": {
         "uuid": {
           "version": "3.3.2",
           "version": "3.3.2",
           "from": "uuid@^3.0.1",
           "from": "uuid@^3.0.1",
@@ -124,14 +158,14 @@
       "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz"
       "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz"
     },
     },
     "@sindresorhus/is": {
     "@sindresorhus/is": {
-      "version": "0.13.0",
-      "from": "@sindresorhus/is@>=0.13.0 <0.14.0",
-      "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.13.0.tgz"
+      "version": "0.15.0",
+      "from": "@sindresorhus/is@>=0.15.0 <0.16.0",
+      "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.15.0.tgz"
     },
     },
     "@types/caseless": {
     "@types/caseless": {
-      "version": "0.12.1",
+      "version": "0.12.2",
       "from": "@types/caseless@*",
       "from": "@types/caseless@*",
-      "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz"
+      "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz"
     },
     },
     "@types/console-log-level": {
     "@types/console-log-level": {
       "version": "1.4.0",
       "version": "1.4.0",
@@ -154,9 +188,9 @@
       "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz"
       "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz"
     },
     },
     "@types/node": {
     "@types/node": {
-      "version": "10.12.20",
+      "version": "12.0.8",
       "from": "@types/node@*",
       "from": "@types/node@*",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.20.tgz"
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz"
     },
     },
     "@types/request": {
     "@types/request": {
       "version": "2.48.1",
       "version": "2.48.1",
@@ -173,15 +207,20 @@
       "from": "@types/tough-cookie@*",
       "from": "@types/tough-cookie@*",
       "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz"
       "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz"
     },
     },
+    "abort-controller": {
+      "version": "3.0.0",
+      "from": "abort-controller@>=3.0.0 <4.0.0",
+      "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz"
+    },
     "acorn": {
     "acorn": {
-      "version": "5.7.3",
-      "from": "acorn@>=5.0.3 <6.0.0",
-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz"
+      "version": "6.1.1",
+      "from": "acorn@>=6.0.0 <7.0.0",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz"
     },
     },
     "agent-base": {
     "agent-base": {
-      "version": "4.2.1",
+      "version": "4.3.0",
       "from": "agent-base@>=4.1.0 <5.0.0",
       "from": "agent-base@>=4.1.0 <5.0.0",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz"
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz"
     },
     },
     "ajv": {
     "ajv": {
       "version": "5.5.2",
       "version": "5.5.2",
@@ -189,9 +228,9 @@
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz"
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz"
     },
     },
     "arrify": {
     "arrify": {
-      "version": "1.0.1",
-      "from": "arrify@>=1.0.1 <2.0.0",
-      "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz"
+      "version": "2.0.1",
+      "from": "arrify@>=2.0.0 <3.0.0",
+      "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz"
     },
     },
     "asn1": {
     "asn1": {
       "version": "0.1.11",
       "version": "0.1.11",
@@ -240,9 +279,9 @@
       "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz"
       "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz"
     },
     },
     "axios": {
     "axios": {
-      "version": "0.18.0",
+      "version": "0.18.1",
       "from": "axios@>=0.18.0 <0.19.0",
       "from": "axios@>=0.18.0 <0.19.0",
-      "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz"
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz"
     },
     },
     "balanced-match": {
     "balanced-match": {
       "version": "1.0.0",
       "version": "1.0.0",
@@ -266,9 +305,9 @@
       "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz"
       "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz"
     },
     },
     "bindings": {
     "bindings": {
-      "version": "1.4.0",
+      "version": "1.5.0",
       "from": "bindings@>=1.2.1 <2.0.0",
       "from": "bindings@>=1.2.1 <2.0.0",
-      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz"
+      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
     },
     },
     "bintrees": {
     "bintrees": {
       "version": "1.0.1",
       "version": "1.0.1",
@@ -312,9 +351,9 @@
       "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz"
       "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz"
     },
     },
     "builtin-modules": {
     "builtin-modules": {
-      "version": "3.0.0",
+      "version": "3.1.0",
       "from": "builtin-modules@>=3.0.0 <4.0.0",
       "from": "builtin-modules@>=3.0.0 <4.0.0",
-      "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz"
+      "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz"
     },
     },
     "bunyan": {
     "bunyan": {
       "version": "0.22.3",
       "version": "0.22.3",
@@ -398,9 +437,9 @@
       "resolved": "https://registry.npmjs.org/connect/-/connect-2.8.4.tgz"
       "resolved": "https://registry.npmjs.org/connect/-/connect-2.8.4.tgz"
     },
     },
     "console-log-level": {
     "console-log-level": {
-      "version": "1.4.0",
+      "version": "1.4.1",
       "from": "console-log-level@>=1.4.0 <2.0.0",
       "from": "console-log-level@>=1.4.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.0.tgz"
+      "resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.1.tgz"
     },
     },
     "continuation-local-storage": {
     "continuation-local-storage": {
       "version": "3.2.1",
       "version": "3.2.1",
@@ -469,9 +508,9 @@
       }
       }
     },
     },
     "delay": {
     "delay": {
-      "version": "4.1.0",
+      "version": "4.3.0",
       "from": "delay@>=4.0.1 <5.0.0",
       "from": "delay@>=4.0.1 <5.0.0",
-      "resolved": "https://registry.npmjs.org/delay/-/delay-4.1.0.tgz"
+      "resolved": "https://registry.npmjs.org/delay/-/delay-4.3.0.tgz"
     },
     },
     "delayed-stream": {
     "delayed-stream": {
       "version": "0.0.5",
       "version": "0.0.5",
@@ -479,9 +518,9 @@
       "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
       "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
     },
     },
     "denque": {
     "denque": {
-      "version": "1.4.0",
+      "version": "1.4.1",
       "from": "denque@>=1.1.0 <2.0.0",
       "from": "denque@>=1.1.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.0.tgz"
+      "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz"
     },
     },
     "diff": {
     "diff": {
       "version": "3.5.0",
       "version": "3.5.0",
@@ -497,9 +536,9 @@
       "optional": true
       "optional": true
     },
     },
     "duplexify": {
     "duplexify": {
-      "version": "3.6.1",
+      "version": "3.7.1",
       "from": "duplexify@>=3.6.0 <4.0.0",
       "from": "duplexify@>=3.6.0 <4.0.0",
-      "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz"
+      "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz"
     },
     },
     "each-series": {
     "each-series": {
       "version": "1.0.0",
       "version": "1.0.0",
@@ -513,9 +552,9 @@
       "optional": true
       "optional": true
     },
     },
     "ecdsa-sig-formatter": {
     "ecdsa-sig-formatter": {
-      "version": "1.0.10",
-      "from": "ecdsa-sig-formatter@1.0.10",
-      "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz"
+      "version": "1.0.11",
+      "from": "ecdsa-sig-formatter@1.0.11",
+      "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz"
     },
     },
     "emitter-listener": {
     "emitter-listener": {
       "version": "1.1.2",
       "version": "1.1.2",
@@ -533,9 +572,9 @@
       "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz"
       "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz"
     },
     },
     "es6-promise": {
     "es6-promise": {
-      "version": "4.2.5",
+      "version": "4.2.8",
       "from": "es6-promise@>=4.0.3 <5.0.0",
       "from": "es6-promise@>=4.0.3 <5.0.0",
-      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz"
+      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz"
     },
     },
     "es6-promisify": {
     "es6-promisify": {
       "version": "5.0.0",
       "version": "5.0.0",
@@ -548,6 +587,11 @@
       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
       "dev": true
       "dev": true
     },
     },
+    "event-target-shim": {
+      "version": "5.0.1",
+      "from": "event-target-shim@>=5.0.0 <6.0.0",
+      "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz"
+    },
     "express": {
     "express": {
       "version": "3.3.4",
       "version": "3.3.4",
       "from": "express@3.3.4",
       "from": "express@3.3.4",
@@ -588,15 +632,10 @@
       "from": "findit2@>=2.2.3 <3.0.0",
       "from": "findit2@>=2.2.3 <3.0.0",
       "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz"
       "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz"
     },
     },
-    "flexbuffer": {
-      "version": "0.0.6",
-      "from": "flexbuffer@0.0.6",
-      "resolved": "https://registry.npmjs.org/flexbuffer/-/flexbuffer-0.0.6.tgz"
-    },
     "follow-redirects": {
     "follow-redirects": {
-      "version": "1.6.1",
-      "from": "follow-redirects@>=1.3.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz"
+      "version": "1.5.10",
+      "from": "follow-redirects@1.5.10",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz"
     },
     },
     "forever-agent": {
     "forever-agent": {
       "version": "0.5.2",
       "version": "0.5.2",
@@ -632,9 +671,9 @@
       "dev": true
       "dev": true
     },
     },
     "gaxios": {
     "gaxios": {
-      "version": "1.2.7",
-      "from": "gaxios@>=1.0.4 <2.0.0",
-      "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.2.7.tgz",
+      "version": "1.8.4",
+      "from": "gaxios@>=1.2.1 <2.0.0",
+      "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.4.tgz",
       "dependencies": {
       "dependencies": {
         "extend": {
         "extend": {
           "version": "3.0.2",
           "version": "3.0.2",
@@ -644,9 +683,9 @@
       }
       }
     },
     },
     "gcp-metadata": {
     "gcp-metadata": {
-      "version": "0.9.3",
-      "from": "gcp-metadata@>=0.9.0 <0.10.0",
-      "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.9.3.tgz"
+      "version": "1.0.0",
+      "from": "gcp-metadata@>=1.0.0 <2.0.0",
+      "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz"
     },
     },
     "getpass": {
     "getpass": {
       "version": "0.1.7",
       "version": "0.1.7",
@@ -667,31 +706,24 @@
       "optional": true
       "optional": true
     },
     },
     "google-auth-library": {
     "google-auth-library": {
-      "version": "2.0.2",
-      "from": "google-auth-library@>=2.0.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-2.0.2.tgz",
-      "dependencies": {
-        "gcp-metadata": {
-          "version": "0.7.0",
-          "from": "gcp-metadata@>=0.7.0 <0.8.0",
-          "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.7.0.tgz"
-        }
-      }
+      "version": "3.1.2",
+      "from": "google-auth-library@>=3.1.1 <4.0.0",
+      "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz"
     },
     },
     "google-p12-pem": {
     "google-p12-pem": {
-      "version": "1.0.3",
+      "version": "1.0.4",
       "from": "google-p12-pem@>=1.0.0 <2.0.0",
       "from": "google-p12-pem@>=1.0.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.3.tgz"
+      "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.4.tgz"
     },
     },
     "gtoken": {
     "gtoken": {
-      "version": "2.3.2",
-      "from": "gtoken@>=2.3.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz",
+      "version": "2.3.3",
+      "from": "gtoken@>=2.3.2 <3.0.0",
+      "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz",
       "dependencies": {
       "dependencies": {
         "mime": {
         "mime": {
-          "version": "2.4.0",
+          "version": "2.4.4",
           "from": "mime@>=2.2.0 <3.0.0",
           "from": "mime@>=2.2.0 <3.0.0",
-          "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz"
+          "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz"
         }
         }
       }
       }
     },
     },
@@ -747,9 +779,9 @@
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
     },
     },
     "ioredis": {
     "ioredis": {
-      "version": "4.6.0",
-      "from": "ioredis@4.6.0",
-      "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.6.0.tgz"
+      "version": "4.9.5",
+      "from": "ioredis@>=4.9.1 <4.10.0",
+      "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.9.5.tgz"
     },
     },
     "is": {
     "is": {
       "version": "3.3.0",
       "version": "3.3.0",
@@ -757,9 +789,9 @@
       "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz"
       "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz"
     },
     },
     "is-buffer": {
     "is-buffer": {
-      "version": "1.1.6",
-      "from": "is-buffer@>=1.1.5 <2.0.0",
-      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
+      "version": "2.0.3",
+      "from": "is-buffer@>=2.0.2 <3.0.0",
+      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz"
     },
     },
     "is-typedarray": {
     "is-typedarray": {
       "version": "1.0.0",
       "version": "1.0.0",
@@ -815,14 +847,14 @@
       }
       }
     },
     },
     "jwa": {
     "jwa": {
-      "version": "1.2.0",
-      "from": "jwa@>=1.2.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.2.0.tgz"
+      "version": "1.4.1",
+      "from": "jwa@>=1.4.1 <2.0.0",
+      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz"
     },
     },
     "jws": {
     "jws": {
-      "version": "3.2.1",
+      "version": "3.2.2",
       "from": "jws@>=3.1.5 <4.0.0",
       "from": "jws@>=3.1.5 <4.0.0",
-      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.1.tgz"
+      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz"
     },
     },
     "keypress": {
     "keypress": {
       "version": "0.1.0",
       "version": "0.1.0",
@@ -850,14 +882,14 @@
       "resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz"
       "resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz"
     },
     },
     "logger-sharelatex": {
     "logger-sharelatex": {
-      "version": "1.6.0",
-      "from": "logger-sharelatex@1.6.0",
-      "resolved": "https://registry.npmjs.org/logger-sharelatex/-/logger-sharelatex-1.6.0.tgz",
+      "version": "1.7.0",
+      "from": "logger-sharelatex@1.7.0",
+      "resolved": "https://registry.npmjs.org/logger-sharelatex/-/logger-sharelatex-1.7.0.tgz",
       "dependencies": {
       "dependencies": {
         "ajv": {
         "ajv": {
-          "version": "6.7.0",
+          "version": "6.10.0",
           "from": "ajv@>=6.5.5 <7.0.0",
           "from": "ajv@>=6.5.5 <7.0.0",
-          "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz"
+          "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz"
         },
         },
         "assert-plus": {
         "assert-plus": {
           "version": "1.0.0",
           "version": "1.0.0",
@@ -870,19 +902,14 @@
           "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz"
           "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz"
         },
         },
         "bunyan": {
         "bunyan": {
-          "version": "1.5.1",
-          "from": "bunyan@1.5.1",
-          "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.5.1.tgz"
-        },
-        "coffee-script": {
-          "version": "1.12.4",
-          "from": "coffee-script@1.12.4",
-          "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.4.tgz"
+          "version": "1.8.12",
+          "from": "bunyan@1.8.12",
+          "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz"
         },
         },
         "combined-stream": {
         "combined-stream": {
-          "version": "1.0.7",
+          "version": "1.0.8",
           "from": "combined-stream@>=1.0.6 <1.1.0",
           "from": "combined-stream@>=1.0.6 <1.1.0",
-          "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz"
+          "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
         },
         },
         "delayed-stream": {
         "delayed-stream": {
           "version": "1.0.0",
           "version": "1.0.0",
@@ -890,9 +917,9 @@
           "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
           "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
         },
         },
         "dtrace-provider": {
         "dtrace-provider": {
-          "version": "0.6.0",
-          "from": "dtrace-provider@>=0.6.0 <0.7.0",
-          "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.6.0.tgz",
+          "version": "0.8.7",
+          "from": "dtrace-provider@>=0.8.0 <0.9.0",
+          "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.7.tgz",
           "optional": true
           "optional": true
         },
         },
         "extend": {
         "extend": {
@@ -931,14 +958,14 @@
           "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
           "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
         },
         },
         "mime-db": {
         "mime-db": {
-          "version": "1.37.0",
-          "from": "mime-db@>=1.37.0 <1.38.0",
-          "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz"
+          "version": "1.40.0",
+          "from": "mime-db@1.40.0",
+          "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz"
         },
         },
         "mime-types": {
         "mime-types": {
-          "version": "2.1.21",
+          "version": "2.1.24",
           "from": "mime-types@>=2.1.19 <2.2.0",
           "from": "mime-types@>=2.1.19 <2.2.0",
-          "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz"
+          "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz"
         },
         },
         "oauth-sign": {
         "oauth-sign": {
           "version": "0.9.0",
           "version": "0.9.0",
@@ -1008,9 +1035,9 @@
       "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz"
       "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz"
     },
     },
     "metrics-sharelatex": {
     "metrics-sharelatex": {
-      "version": "2.1.1",
-      "from": "metrics-sharelatex@2.1.1",
-      "resolved": "https://registry.npmjs.org/metrics-sharelatex/-/metrics-sharelatex-2.1.1.tgz",
+      "version": "2.2.0",
+      "from": "metrics-sharelatex@2.2.0",
+      "resolved": "https://registry.npmjs.org/metrics-sharelatex/-/metrics-sharelatex-2.2.0.tgz",
       "dependencies": {
       "dependencies": {
         "coffee-script": {
         "coffee-script": {
           "version": "1.6.0",
           "version": "1.6.0",
@@ -1021,11 +1048,6 @@
           "version": "0.1.1",
           "version": "0.1.1",
           "from": "lynx@>=0.1.1 <0.2.0",
           "from": "lynx@>=0.1.1 <0.2.0",
           "resolved": "https://registry.npmjs.org/lynx/-/lynx-0.1.1.tgz"
           "resolved": "https://registry.npmjs.org/lynx/-/lynx-0.1.1.tgz"
-        },
-        "underscore": {
-          "version": "1.6.0",
-          "from": "underscore@>=1.6.0 <1.7.0",
-          "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
         }
         }
       }
       }
     },
     },
@@ -1108,6 +1130,12 @@
       "from": "module-details-from-path@>=1.0.3 <2.0.0",
       "from": "module-details-from-path@>=1.0.3 <2.0.0",
       "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz"
       "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz"
     },
     },
+    "moment": {
+      "version": "2.24.0",
+      "from": "moment@>=2.10.6 <3.0.0",
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
+      "optional": true
+    },
     "mongodb": {
     "mongodb": {
       "version": "2.2.36",
       "version": "2.2.36",
       "from": "mongodb@^2.2.31",
       "from": "mongodb@^2.2.31",
@@ -1176,14 +1204,14 @@
       "optional": true
       "optional": true
     },
     },
     "node-fetch": {
     "node-fetch": {
-      "version": "2.3.0",
-      "from": "node-fetch@>=2.2.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz"
+      "version": "2.6.0",
+      "from": "node-fetch@>=2.3.0 <3.0.0",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz"
     },
     },
     "node-forge": {
     "node-forge": {
-      "version": "0.7.6",
-      "from": "node-forge@>=0.7.4 <0.8.0",
-      "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz"
+      "version": "0.8.4",
+      "from": "node-forge@>=0.8.0 <0.9.0",
+      "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.4.tgz"
     },
     },
     "oauth-sign": {
     "oauth-sign": {
       "version": "0.3.0",
       "version": "0.3.0",
@@ -1196,14 +1224,14 @@
       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
     },
     },
     "p-limit": {
     "p-limit": {
-      "version": "2.1.0",
-      "from": "p-limit@>=2.0.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz"
+      "version": "2.2.0",
+      "from": "p-limit@>=2.2.0 <3.0.0",
+      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz"
     },
     },
     "p-try": {
     "p-try": {
-      "version": "2.0.0",
+      "version": "2.2.0",
       "from": "p-try@>=2.0.0 <3.0.0",
       "from": "p-try@>=2.0.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz"
+      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
     },
     },
     "parse-duration": {
     "parse-duration": {
       "version": "0.1.1",
       "version": "0.1.1",
@@ -1216,9 +1244,9 @@
       "resolved": "https://registry.npmjs.org/parse-mongo-url/-/parse-mongo-url-1.1.1.tgz"
       "resolved": "https://registry.npmjs.org/parse-mongo-url/-/parse-mongo-url-1.1.1.tgz"
     },
     },
     "parse-ms": {
     "parse-ms": {
-      "version": "2.0.0",
+      "version": "2.1.0",
       "from": "parse-ms@>=2.0.0 <3.0.0",
       "from": "parse-ms@>=2.0.0 <3.0.0",
-      "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.0.0.tgz"
+      "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz"
     },
     },
     "path-is-absolute": {
     "path-is-absolute": {
       "version": "1.0.1",
       "version": "1.0.1",
@@ -1256,19 +1284,26 @@
       "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz"
       "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz"
     },
     },
     "prom-client": {
     "prom-client": {
-      "version": "11.2.1",
+      "version": "11.5.1",
       "from": "prom-client@>=11.1.3 <12.0.0",
       "from": "prom-client@>=11.1.3 <12.0.0",
-      "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-11.2.1.tgz"
+      "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-11.5.1.tgz"
     },
     },
     "protobufjs": {
     "protobufjs": {
       "version": "6.8.8",
       "version": "6.8.8",
       "from": "protobufjs@>=6.8.6 <6.9.0",
       "from": "protobufjs@>=6.8.6 <6.9.0",
-      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz"
+      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz",
+      "dependencies": {
+        "@types/node": {
+          "version": "10.14.9",
+          "from": "@types/node@>=10.1.0 <11.0.0",
+          "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.9.tgz"
+        }
+      }
     },
     },
     "psl": {
     "psl": {
-      "version": "1.1.31",
+      "version": "1.1.32",
       "from": "psl@>=1.1.24 <2.0.0",
       "from": "psl@>=1.1.24 <2.0.0",
-      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz"
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz"
     },
     },
     "punycode": {
     "punycode": {
       "version": "1.4.1",
       "version": "1.4.1",
@@ -1291,9 +1326,9 @@
       "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz"
       "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz"
     },
     },
     "raven": {
     "raven": {
-      "version": "1.2.1",
-      "from": "raven@>=1.1.3 <2.0.0",
-      "resolved": "https://registry.npmjs.org/raven/-/raven-1.2.1.tgz",
+      "version": "1.1.3",
+      "from": "raven@1.1.3",
+      "resolved": "https://registry.npmjs.org/raven/-/raven-1.1.3.tgz",
       "dependencies": {
       "dependencies": {
         "cookie": {
         "cookie": {
           "version": "0.3.1",
           "version": "0.3.1",
@@ -1308,9 +1343,9 @@
       "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz"
       "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz"
     },
     },
     "redis": {
     "redis": {
-      "version": "0.12.1",
-      "from": "redis@0.12.1",
-      "resolved": "https://registry.npmjs.org/redis/-/redis-0.12.1.tgz"
+      "version": "0.11.0",
+      "from": "redis@>=0.11.0 <0.12.0",
+      "resolved": "https://registry.npmjs.org/redis/-/redis-0.11.0.tgz"
     },
     },
     "redis-commands": {
     "redis-commands": {
       "version": "1.4.0",
       "version": "1.4.0",
@@ -1330,19 +1365,12 @@
     "redis-sentinel": {
     "redis-sentinel": {
       "version": "0.1.1",
       "version": "0.1.1",
       "from": "redis-sentinel@0.1.1",
       "from": "redis-sentinel@0.1.1",
-      "resolved": "https://registry.npmjs.org/redis-sentinel/-/redis-sentinel-0.1.1.tgz",
-      "dependencies": {
-        "redis": {
-          "version": "0.11.0",
-          "from": "redis@>=0.11.0 <0.12.0",
-          "resolved": "https://registry.npmjs.org/redis/-/redis-0.11.0.tgz"
-        }
-      }
+      "resolved": "https://registry.npmjs.org/redis-sentinel/-/redis-sentinel-0.1.1.tgz"
     },
     },
     "redis-sharelatex": {
     "redis-sharelatex": {
-      "version": "1.0.5",
-      "from": "redis-sharelatex@latest",
-      "resolved": "https://registry.npmjs.org/redis-sharelatex/-/redis-sharelatex-1.0.5.tgz",
+      "version": "1.0.8",
+      "from": "redis-sharelatex@1.0.8",
+      "resolved": "https://registry.npmjs.org/redis-sharelatex/-/redis-sharelatex-1.0.8.tgz",
       "dependencies": {
       "dependencies": {
         "coffee-script": {
         "coffee-script": {
           "version": "1.8.0",
           "version": "1.8.0",
@@ -1468,9 +1496,21 @@
       "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz"
       "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz"
     },
     },
     "require-in-the-middle": {
     "require-in-the-middle": {
-      "version": "3.1.0",
-      "from": "require-in-the-middle@>=3.0.0 <4.0.0",
-      "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-3.1.0.tgz"
+      "version": "4.0.0",
+      "from": "require-in-the-middle@>=4.0.0 <5.0.0",
+      "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-4.0.0.tgz",
+      "dependencies": {
+        "debug": {
+          "version": "4.1.1",
+          "from": "debug@>=4.1.1 <5.0.0",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz"
+        },
+        "ms": {
+          "version": "2.1.2",
+          "from": "ms@>=2.1.1 <3.0.0",
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"
+        }
+      }
     },
     },
     "require-like": {
     "require-like": {
       "version": "0.1.2",
       "version": "0.1.2",
@@ -1478,9 +1518,9 @@
       "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz"
       "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz"
     },
     },
     "resolve": {
     "resolve": {
-      "version": "1.10.0",
-      "from": "resolve@>=1.5.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz"
+      "version": "1.11.0",
+      "from": "resolve@>=1.10.0 <2.0.0",
+      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz"
     },
     },
     "resolve-from": {
     "resolve-from": {
       "version": "2.0.0",
       "version": "2.0.0",
@@ -1596,9 +1636,9 @@
       "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz"
       "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz"
     },
     },
     "standard-as-callback": {
     "standard-as-callback": {
-      "version": "1.0.1",
-      "from": "standard-as-callback@>=1.0.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-1.0.1.tgz"
+      "version": "2.0.1",
+      "from": "standard-as-callback@>=2.0.1 <3.0.0",
+      "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.0.1.tgz"
     },
     },
     "statsd-parser": {
     "statsd-parser": {
       "version": "0.0.4",
       "version": "0.0.4",
@@ -1620,11 +1660,6 @@
       "from": "stringstream@>=0.0.5 <0.1.0",
       "from": "stringstream@>=0.0.5 <0.1.0",
       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz"
       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz"
     },
     },
-    "symbol-observable": {
-      "version": "1.2.0",
-      "from": "symbol-observable@>=1.2.0 <2.0.0",
-      "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz"
-    },
     "tdigest": {
     "tdigest": {
       "version": "0.1.1",
       "version": "0.1.1",
       "from": "tdigest@>=0.1.1 <0.2.0",
       "from": "tdigest@>=0.1.1 <0.2.0",
@@ -1689,6 +1724,11 @@
       "from": "uid2@0.0.2",
       "from": "uid2@0.0.2",
       "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.2.tgz"
       "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.2.tgz"
     },
     },
+    "underscore": {
+      "version": "1.6.0",
+      "from": "underscore@>=1.6.0 <1.7.0",
+      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
+    },
     "uri-js": {
     "uri-js": {
       "version": "4.2.2",
       "version": "4.2.2",
       "from": "uri-js@>=4.2.2 <5.0.0",
       "from": "uri-js@>=4.2.2 <5.0.0",

+ 3 - 3
services/document-updater/package.json

@@ -24,11 +24,11 @@
     "coffee-script": "~1.7.0",
     "coffee-script": "~1.7.0",
     "express": "3.3.4",
     "express": "3.3.4",
     "lodash": "^4.17.4",
     "lodash": "^4.17.4",
-    "logger-sharelatex": "^1.6.0",
+    "logger-sharelatex": "^1.7.0",
     "lynx": "0.0.11",
     "lynx": "0.0.11",
-    "metrics-sharelatex": "^2.1.1",
+    "metrics-sharelatex": "^2.2.0",
     "mongojs": "^2.6.0",
     "mongojs": "^2.6.0",
-    "redis-sharelatex": "^1.0.5",
+    "redis-sharelatex": "^1.0.8",
     "request": "2.25.0",
     "request": "2.25.0",
     "requestretry": "^1.12.0",
     "requestretry": "^1.12.0",
     "sandboxed-module": "~0.2.0",
     "sandboxed-module": "~0.2.0",

+ 22 - 0
services/document-updater/test/acceptance/coffee/ApplyingUpdatesToADocTests.coffee

@@ -38,6 +38,7 @@ describe "Applying updates to a doc", ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, @update, (error) ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, @update, (error) ->
 				throw error if error?
 				throw error if error?
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		after ->
 		after ->
 			MockWebApi.getDocument.restore()
 			MockWebApi.getDocument.restore()
@@ -51,6 +52,7 @@ describe "Applying updates to a doc", ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @result
 				doc.lines.should.deep.equal @result
 				done()
 				done()
+			return null
 
 
 		it "should push the applied updates to the track changes api", (done) ->
 		it "should push the applied updates to the track changes api", (done) ->
 			rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
@@ -60,12 +62,14 @@ describe "Applying updates to a doc", ->
 					throw error if error?
 					throw error if error?
 					result.should.equal 1
 					result.should.equal 1
 					done()
 					done()
+			return null
 
 
 		it "should push the applied updates to the project history changes api", (done) ->
 		it "should push the applied updates to the project history changes api", (done) ->
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 				throw error if error?
 				throw error if error?
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
 				done()
 				done()
+			return null
 
 
 		it "should set the first op timestamp", (done) ->
 		it "should set the first op timestamp", (done) ->
 			rclient_history.get ProjectHistoryKeys.projectHistoryFirstOpTimestamp({@project_id}), (error, result) =>
 			rclient_history.get ProjectHistoryKeys.projectHistoryFirstOpTimestamp({@project_id}), (error, result) =>
@@ -73,6 +77,7 @@ describe "Applying updates to a doc", ->
 				result.should.be.within(@startTime, Date.now())
 				result.should.be.within(@startTime, Date.now())
 				@firstOpTimestamp = result
 				@firstOpTimestamp = result
 				done()
 				done()
+			return null
 
 
 		describe "when sending another update", ->
 		describe "when sending another update", ->
 			before (done) ->
 			before (done) ->
@@ -81,12 +86,14 @@ describe "Applying updates to a doc", ->
 				DocUpdaterClient.sendUpdate @project_id, @doc_id, @second_update, (error) ->
 				DocUpdaterClient.sendUpdate @project_id, @doc_id, @second_update, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 200
 					setTimeout done, 200
+				return null
 
 
 			it "should not change the first op timestamp", (done) ->
 			it "should not change the first op timestamp", (done) ->
 				rclient_history.get ProjectHistoryKeys.projectHistoryFirstOpTimestamp({@project_id}), (error, result) =>
 				rclient_history.get ProjectHistoryKeys.projectHistoryFirstOpTimestamp({@project_id}), (error, result) =>
 					throw error if error?
 					throw error if error?
 					result.should.equal @firstOpTimestamp
 					result.should.equal @firstOpTimestamp
 					done()
 					done()
+				return null
 
 
 	describe "when the document is loaded", ->
 	describe "when the document is loaded", ->
 		before (done) ->
 		before (done) ->
@@ -99,6 +106,7 @@ describe "Applying updates to a doc", ->
 				DocUpdaterClient.sendUpdate @project_id, @doc_id, @update, (error) ->
 				DocUpdaterClient.sendUpdate @project_id, @doc_id, @update, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 200
 					setTimeout done, 200
+			return null
 
 
 		after ->
 		after ->
 			MockWebApi.getDocument.restore()
 			MockWebApi.getDocument.restore()
@@ -110,6 +118,7 @@ describe "Applying updates to a doc", ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @result
 				doc.lines.should.deep.equal @result
 				done()
 				done()
+			return null
 
 
 		it "should push the applied updates to the track changes api", (done) ->
 		it "should push the applied updates to the track changes api", (done) ->
 			rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
@@ -117,11 +126,13 @@ describe "Applying updates to a doc", ->
 				rclient_history.sismember HistoryKeys.docsWithHistoryOps({@project_id}), @doc_id, (error, result) =>
 				rclient_history.sismember HistoryKeys.docsWithHistoryOps({@project_id}), @doc_id, (error, result) =>
 					result.should.equal 1
 					result.should.equal 1
 					done()
 					done()
+			return null
 
 
 		it "should push the applied updates to the project history changes api", (done) ->
 		it "should push the applied updates to the project history changes api", (done) ->
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
 				JSON.parse(updates[0]).op.should.deep.equal @update.op
 				done()
 				done()
+			return null
 
 
 
 
 	describe "when the document has been deleted", ->
 	describe "when the document has been deleted", ->
@@ -161,6 +172,7 @@ describe "Applying updates to a doc", ->
 					DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 					DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 						doc.lines.should.deep.equal @my_result
 						doc.lines.should.deep.equal @my_result
 						done()
 						done()
+				return null
 
 
 			it "should push the applied updates to the track changes api", (done) ->
 			it "should push the applied updates to the track changes api", (done) ->
 				rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
 				rclient_history.lrange HistoryKeys.uncompressedHistoryOps({@doc_id}), 0, -1, (error, updates) =>
@@ -171,6 +183,7 @@ describe "Applying updates to a doc", ->
 					rclient_history.sismember HistoryKeys.docsWithHistoryOps({@project_id}), @doc_id, (error, result) =>
 					rclient_history.sismember HistoryKeys.docsWithHistoryOps({@project_id}), @doc_id, (error, result) =>
 						result.should.equal 1
 						result.should.equal 1
 						done()
 						done()
+				return null
 
 
 			it "should store the doc ops in the correct order", (done) ->
 			it "should store the doc ops in the correct order", (done) ->
 				rclient_du.lrange Keys.docOps({doc_id: @doc_id}), 0, -1, (error, updates) =>
 				rclient_du.lrange Keys.docOps({doc_id: @doc_id}), 0, -1, (error, updates) =>
@@ -178,6 +191,7 @@ describe "Applying updates to a doc", ->
 					for appliedUpdate, i in @updates
 					for appliedUpdate, i in @updates
 						appliedUpdate.op.should.deep.equal updates[i].op
 						appliedUpdate.op.should.deep.equal updates[i].op
 					done()
 					done()
+				return null
 
 
 		describe "when older ops come in after the delete", ->
 		describe "when older ops come in after the delete", ->
 			before (done) ->
 			before (done) ->
@@ -210,6 +224,7 @@ describe "Applying updates to a doc", ->
 					DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 					DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 						doc.lines.should.deep.equal @my_result
 						doc.lines.should.deep.equal @my_result
 						done()
 						done()
+				return null
 
 
 	describe "with a broken update", ->
 	describe "with a broken update", ->
 		before (done) ->
 		before (done) ->
@@ -222,11 +237,13 @@ describe "Applying updates to a doc", ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, @broken_update, (error) ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, @broken_update, (error) ->
 				throw error if error?
 				throw error if error?
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		it "should not update the doc", (done) ->
 		it "should not update the doc", (done) ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @lines
 				doc.lines.should.deep.equal @lines
 				done()
 				done()
+			return null
 
 
 		it "should send a message with an error", ->
 		it "should send a message with an error", ->
 			@messageCallback.called.should.equal true
 			@messageCallback.called.should.equal true
@@ -261,6 +278,7 @@ describe "Applying updates to a doc", ->
 			async.series actions, (error) =>
 			async.series actions, (error) =>
 				throw error if error?
 				throw error if error?
 				setTimeout done, 2000
 				setTimeout done, 2000
+			return null
 
 
 		after ->
 		after ->
 			MockTrackChangesApi.flushDoc.restore()
 			MockTrackChangesApi.flushDoc.restore()
@@ -282,11 +300,13 @@ describe "Applying updates to a doc", ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, update, (error) ->
 			DocUpdaterClient.sendUpdate @project_id, @doc_id, update, (error) ->
 				throw error if error?
 				throw error if error?
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		it "should update the doc (using version = 0)", (done) ->
 		it "should update the doc (using version = 0)", (done) ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @result
 				doc.lines.should.deep.equal @result
 				done()
 				done()
+			return null
 
 
 	describe "when the sending duplicate ops", ->
 	describe "when the sending duplicate ops", ->
 		before (done) ->
 		before (done) ->
@@ -322,11 +342,13 @@ describe "Applying updates to a doc", ->
 						throw error if error?
 						throw error if error?
 						setTimeout done, 200
 						setTimeout done, 200
 				, 200
 				, 200
+			return null
 
 
 		it "should update the doc", (done) ->
 		it "should update the doc", (done) ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @result
 				doc.lines.should.deep.equal @result
 				done()
 				done()
+			return null
 
 
 		it "should return a message about duplicate ops", ->
 		it "should return a message about duplicate ops", ->
 			@messageCallback.calledTwice.should.equal true
 			@messageCallback.calledTwice.should.equal true

+ 14 - 0
services/document-updater/test/acceptance/coffee/ApplyingUpdatesToProjectStructureTests.coffee

@@ -42,6 +42,7 @@ describe "Applying updates to a project's structure", ->
 				update.version.should.equal "#{@version}.0"
 				update.version.should.equal "#{@version}.0"
 
 
 				done()
 				done()
+			return null
 
 
 	describe "renaming a document", ->
 	describe "renaming a document", ->
 		before ->
 		before ->
@@ -57,6 +58,7 @@ describe "Applying updates to a project's structure", ->
 				DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 				DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 200
 					setTimeout done, 200
+				return null
 
 
 			it "should push the applied doc renames to the project history api", (done) ->
 			it "should push the applied doc renames to the project history api", (done) ->
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
@@ -71,6 +73,7 @@ describe "Applying updates to a project's structure", ->
 					update.version.should.equal "#{@version}.0"
 					update.version.should.equal "#{@version}.0"
 
 
 					done()
 					done()
+				return null
 
 
 		describe "when the document is loaded", ->
 		describe "when the document is loaded", ->
 			before (done) ->
 			before (done) ->
@@ -82,6 +85,7 @@ describe "Applying updates to a project's structure", ->
 					DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 					DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 						throw error if error?
 						throw error if error?
 						setTimeout done, 200
 						setTimeout done, 200
+				return null
 
 
 			after ->
 			after ->
 				MockWebApi.getDocument.restore()
 				MockWebApi.getDocument.restore()
@@ -90,6 +94,7 @@ describe "Applying updates to a project's structure", ->
 				DocUpdaterClient.getDoc @project_id, @docUpdate.id, (error, res, doc) =>
 				DocUpdaterClient.getDoc @project_id, @docUpdate.id, (error, res, doc) =>
 					doc.pathname.should.equal @docUpdate.newPathname
 					doc.pathname.should.equal @docUpdate.newPathname
 					done()
 					done()
+				return null
 
 
 			it "should push the applied doc renames to the project history api", (done) ->
 			it "should push the applied doc renames to the project history api", (done) ->
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
@@ -104,6 +109,7 @@ describe "Applying updates to a project's structure", ->
 					update.version.should.equal "#{@version}.0"
 					update.version.should.equal "#{@version}.0"
 
 
 					done()
 					done()
+				return null
 
 
 	describe "renaming multiple documents and files", ->
 	describe "renaming multiple documents and files", ->
 		before ->
 		before ->
@@ -132,6 +138,7 @@ describe "Applying updates to a project's structure", ->
 				DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, @fileUpdates, @version, (error) ->
 				DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, @fileUpdates, @version, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 200
 					setTimeout done, 200
+				return null
 
 
 			it "should push the applied doc renames to the project history api", (done) ->
 			it "should push the applied doc renames to the project history api", (done) ->
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 				rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
@@ -170,6 +177,7 @@ describe "Applying updates to a project's structure", ->
 					update.version.should.equal "#{@version}.3"
 					update.version.should.equal "#{@version}.3"
 
 
 					done()
 					done()
+				return null
 
 
 
 
 	describe "adding a file", ->
 	describe "adding a file", ->
@@ -183,6 +191,7 @@ describe "Applying updates to a project's structure", ->
 			DocUpdaterClient.sendProjectUpdate @project_id, @user_id, [], @fileUpdates, @version, (error) ->
 			DocUpdaterClient.sendProjectUpdate @project_id, @user_id, [], @fileUpdates, @version, (error) ->
 				throw error if error?
 				throw error if error?
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		it "should push the file addition to the project history api", (done) ->
 		it "should push the file addition to the project history api", (done) ->
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
@@ -197,6 +206,7 @@ describe "Applying updates to a project's structure", ->
 				update.version.should.equal "#{@version}.0"
 				update.version.should.equal "#{@version}.0"
 
 
 				done()
 				done()
+			return null
 
 
 	describe "adding a doc", ->
 	describe "adding a doc", ->
 		before (done) ->
 		before (done) ->
@@ -209,6 +219,7 @@ describe "Applying updates to a project's structure", ->
 			DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 			DocUpdaterClient.sendProjectUpdate @project_id, @user_id, @docUpdates, [], @version, (error) ->
 				throw error if error?
 				throw error if error?
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		it "should push the doc addition to the project history api", (done) ->
 		it "should push the doc addition to the project history api", (done) ->
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
 			rclient_history.lrange ProjectHistoryKeys.projectHistoryOps({@project_id}), 0, -1, (error, updates) =>
@@ -223,6 +234,7 @@ describe "Applying updates to a project's structure", ->
 				update.version.should.equal "#{@version}.0"
 				update.version.should.equal "#{@version}.0"
 
 
 				done()
 				done()
+			return null
 
 
 	describe "with enough updates to flush to the history service", ->
 	describe "with enough updates to flush to the history service", ->
 		before (done) ->
 		before (done) ->
@@ -247,6 +259,7 @@ describe "Applying updates to a project's structure", ->
 				DocUpdaterClient.sendProjectUpdate projectId, userId, updates.slice(250), [], @version1, (error) ->
 				DocUpdaterClient.sendProjectUpdate projectId, userId, updates.slice(250), [], @version1, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 2000
 					setTimeout done, 2000
+			return null
 
 
 		after ->
 		after ->
 			MockProjectHistoryApi.flushProject.restore()
 			MockProjectHistoryApi.flushProject.restore()
@@ -278,6 +291,7 @@ describe "Applying updates to a project's structure", ->
 				DocUpdaterClient.sendProjectUpdate projectId, userId, updates.slice(10), [], @version1, (error) ->
 				DocUpdaterClient.sendProjectUpdate projectId, userId, updates.slice(10), [], @version1, (error) ->
 					throw error if error?
 					throw error if error?
 					setTimeout done, 2000
 					setTimeout done, 2000
+			return null
 
 
 		after ->
 		after ->
 			MockProjectHistoryApi.flushProject.restore()
 			MockProjectHistoryApi.flushProject.restore()

+ 10 - 0
services/document-updater/test/acceptance/coffee/SettingADocumentTests.coffee

@@ -51,6 +51,7 @@ describe "Setting a document", ->
 							@statusCode = res.statusCode
 							@statusCode = res.statusCode
 							done()
 							done()
 					, 200
 					, 200
+			return null
 
 
 		it "should return a 204 status code", ->
 		it "should return a 204 status code", ->
 			@statusCode.should.equal 204
 			@statusCode.should.equal 204
@@ -64,17 +65,20 @@ describe "Setting a document", ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.lines.should.deep.equal @newLines
 				doc.lines.should.deep.equal @newLines
 				done()
 				done()
+			return null
 
 
 		it "should bump the version in the doc updater", (done) ->
 		it "should bump the version in the doc updater", (done) ->
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 			DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, doc) =>
 				doc.version.should.equal @version + 2
 				doc.version.should.equal @version + 2
 				done()
 				done()
+			return null
 
 
 		it "should leave the document in redis", (done) ->
 		it "should leave the document in redis", (done) ->
 			rclient_du.get Keys.docLines({doc_id: @doc_id}), (error, lines) =>
 			rclient_du.get Keys.docLines({doc_id: @doc_id}), (error, lines) =>
 				throw error if error?
 				throw error if error?
 				expect(JSON.parse(lines)).to.deep.equal @newLines
 				expect(JSON.parse(lines)).to.deep.equal @newLines
 				done()
 				done()
+			return null
 
 
 	describe "when the updated doc does not exist in the doc updater", ->
 	describe "when the updated doc does not exist in the doc updater", ->
 		before (done) ->
 		before (done) ->
@@ -83,6 +87,7 @@ describe "Setting a document", ->
 			DocUpdaterClient.setDocLines @project_id, @doc_id, @newLines, @source, @user_id, false, (error, res, body) =>
 			DocUpdaterClient.setDocLines @project_id, @doc_id, @newLines, @source, @user_id, false, (error, res, body) =>
 				@statusCode = res.statusCode
 				@statusCode = res.statusCode
 				setTimeout done, 200
 				setTimeout done, 200
+			return null
 
 
 		it "should return a 204 status code", ->
 		it "should return a 204 status code", ->
 			@statusCode.should.equal 204
 			@statusCode.should.equal 204
@@ -103,6 +108,7 @@ describe "Setting a document", ->
 				throw error if error?
 				throw error if error?
 				expect(lines).to.not.exist
 				expect(lines).to.not.exist
 				done()
 				done()
+			return null
 
 
 	describe "with track changes", ->
 	describe "with track changes", ->
 		before ->
 		before ->
@@ -131,6 +137,7 @@ describe "Setting a document", ->
 						DocUpdaterClient.setDocLines @project_id, @doc_id, @lines, @source, @user_id, true, (error, res, body) =>
 						DocUpdaterClient.setDocLines @project_id, @doc_id, @lines, @source, @user_id, true, (error, res, body) =>
 							@statusCode = res.statusCode
 							@statusCode = res.statusCode
 							setTimeout done, 200
 							setTimeout done, 200
+				return null
 
 
 			it "should undo the tracked changes", (done) ->
 			it "should undo the tracked changes", (done) ->
 				DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, data) =>
 				DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, data) =>
@@ -138,6 +145,7 @@ describe "Setting a document", ->
 					ranges = data.ranges
 					ranges = data.ranges
 					expect(ranges.changes).to.be.undefined
 					expect(ranges.changes).to.be.undefined
 					done()
 					done()
+				return null
 
 
 		describe "without the undo flag", ->
 		describe "without the undo flag", ->
 			before (done) ->
 			before (done) ->
@@ -151,6 +159,7 @@ describe "Setting a document", ->
 						DocUpdaterClient.setDocLines @project_id, @doc_id, @lines, @source, @user_id, false, (error, res, body) =>
 						DocUpdaterClient.setDocLines @project_id, @doc_id, @lines, @source, @user_id, false, (error, res, body) =>
 							@statusCode = res.statusCode
 							@statusCode = res.statusCode
 							setTimeout done, 200
 							setTimeout done, 200
+				return null
 
 
 			it "should not undo the tracked changes", (done) ->
 			it "should not undo the tracked changes", (done) ->
 				DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, data) =>
 				DocUpdaterClient.getDoc @project_id, @doc_id, (error, res, data) =>
@@ -158,5 +167,6 @@ describe "Setting a document", ->
 					ranges = data.ranges
 					ranges = data.ranges
 					expect(ranges.changes.length).to.equal 1
 					expect(ranges.changes.length).to.equal 1
 					done()
 					done()
+				return null