* [mics] fix "app" label in clsi-cache metrics in dev-env
* [clsi-cache] validate filePath when processing file
* [clsi-cache] meter ingress and egress bandwidth
Files are downloaded directly from nginx, hence we cannot meter egress
in clsi-cache easily.
GitOrigin-RevId: 24de8c41728f0e9c984113c1470dec6153e75f20
The breaking changes here are just for node version for the most part.
The one other breaking change has a workaround and shouldn't affect us
anyway.
GitOrigin-RevId: beb192a38cfc04f6b321e5ab44770a9a64110c30
* Add `no-restricted-globals` eslint rule
Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>
* Change `self` to `window.self`
* Change `innerWidth` to `window.innerWidth`
* Change `confirm` to `window.confirm`
* Change `location` to `window.location`
* Use `location` from `useLocation` hook
* Use location from useLocation hook
Co-authored-by: Antoine <antoine.clausse@overleaf.com>
* Disable no-restricted-globals eslint rule for use of 'self'
* Use `confusing-browser-globals` from npm
* Prevent unexpected globals in workers, using `no-undef`
* Use `self` as a global in workers
* Use unexpected globals in workers, using `no-restricted-globals` in workers
---------
Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>
Co-authored-by: Rebeka <o.dekany@gmail.com>
GitOrigin-RevId: 526986799f5f2edf53c7d978fa85c1e98189565f
* handle 3DS challenges on the subscription dashboard
* add `/user/subscription/sync` endpoint
* upgrade `stripe-js` & rm `react-stripe-js`
* group related unit tests together
* add modules `SubscriptionController` unit tests and convert to async/await
* add `StripeClient` unit tests for 3DS failure
GitOrigin-RevId: 9da4758703f6ef4ec08248b328abddbbdd8e44ad
This will only happen with a same-origin request (or if someone has
tampered with the request - in which case they could set anything).
Co-authored-by: Tim Down <158919+timdown@users.noreply.github.com>
GitOrigin-RevId: 9dfe49f974a476bfe215768d3984dd60a381d37a
* [history-v1-ot] initial implementation of using doc-level history-v1-ot
* [web] fix advancing of the otMigrationStage
Use 'nextStage' for the user provided, desired stage when advancing.
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
* [document-updater] document size check in editor-core
* [history-ot] rename history-v1-ot to history-ot and add types
* [history-ot] apply review feedback
- remove extra !!
- merge variable assignment when processing diff-match-match output
- add helper function for getting docstore lines view of StringFileData
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
* Revert "[document-updater] add safe rollback point for history-ot (#25283)"
This reverts commit d7230dd14a379a27d2c6ab03a006463a18979d06
Signed-off-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
---------
Signed-off-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
GitOrigin-RevId: 89c497782adb0427635d50d02263d6f535b12481
This removes some DeprecationWarnings in history-v1
The update should be safe:
```
3.0.0 / 2018-11-20
Ensure config array items and objects are sealed @fgheorghe
This required a major version bump in case someone
relied on the ability to mutate non-sealed data.
2.0.0 / 2018-07-26
Potential for backward incompatibility requiring a major version bump.
Safe to upgrade to major version 2 if you're using a recent NodeJS version and you're not trying to mutate config arrays.
Added array immutability - jacobemerick
Removed Node V.4 support
```
https://github.com/node-config/node-config/blob/master/History.md
GitOrigin-RevId: 8384247d1ad2cd659703b4ba50edf7212076dcf3
* `"@google-cloud/profiler": "^6.0.3"`
* `bin/npm update pprof`
* `bin/npm update nan`
* `bin/npm update @google-cloud/profiler`
* Ignore false positive of `@typescript-eslint/return-await`
> Returning an awaited value that is not a promise is not allowed
Though the function was promisified
GitOrigin-RevId: 24dbe3e8df2b55c0b9583ac79a61e0956ac3fac0
* [k8s] clsi-cache: increase the number of workers
* [clsi-cache] add a global limit on concurrent writes
* [k8s] clsi-cache: increase timeouts for health checks
* [k8s] clsi-cache: align resource requests with current usage
GitOrigin-RevId: 2aba881ac0e581aa8db78a30d2c58afee6702318
* Set `"type": "module"` in package.json
* Update imports to include file extensions
* Update imports to include file extensions in test files
* Convert webpack files to ESM
* Update configureStore.js for ESM
* Make static-assets CJS, and rename with .cjs
* Misc: update imports to `node:path`
* Add vitest; Remove chai, mocha, sinon, expect, jsdom
* Return promises in conversion-controller, to make testing easier
* Update tests to vitest syntax
* Fix JSON import syntax and babel config
* Import combobo from NPM
* Rename `app.js` to `app.cjs`
This should prevent errors in the production app (https://console.cloud.google.com/cloud-build/builds;region=us-east1/8b42465c-0d07-4a08-b856-aa18c13fae46?project=overleaf-ops)
### Before
```
node@ea395ce612a8:/overleaf/services/latexqc$ node app.js
[...]
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/overleaf/services/latexqc/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///overleaf/services/latexqc/app.js:2:1
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)
```
### After
```
node@ea395ce612a8:/overleaf/services/latexqc$ node app.cjs
--------------------------
===> 😊 Starting Server . . .
===> Environment: production
===> Listening on port: 8082
--------------------------
```
* Rename `app.js` to `app.cjs` (Fixup forgotten one)
* Rename `app.js` to `app.cjs` (Fixup 2)
* Rename asset files to `.js`
Fixes:
```
Refused to execute script from 'https://staging-latexqc.ieee.org/assets/9d6cc24692a7f912ff06.cjs' because its MIME type ('application/octet-stream') is not executable, and strict MIME type checking is enabled.
```
GitOrigin-RevId: f0b618f7fc4062fb6bdc3779dfc5defc5f72d614
* Replace `diskusage` by `fs` in clsi
* Replace `diskusage` by `fs` in clsi-cache
* Update disk space calculations to include block size in bytes
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
* Add warning comments about Docker-for-Mac fs stats being off by a factor
---------
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 02ea07e531b89bb3d10ddfe780348b19cbddad1f
* [clsi-cache] initial revision of the clsi-cache service
* [clsi] send output files to clsi-cache and import from clsi-cache
* [web] pass editorId to clsi
* [web] clear clsi-cache when clearing clsi cache
* [web] add split-tests for controlling clsi-cache rollout
* [web] populate clsi-cache when cloning/creating project from template
* [clsi-cache] produce less noise when populating cache hits 404
* [clsi-cache] push docker image to AR
* [clsi-cache] push docker image to AR
* [clsi-cache] allow compileGroup in job payload
* [clsi-cache] set X-Zone header from latest endpoint
* [clsi-cache] use method POST for /enqueue endpoint
* [web] populate clsi-cache in zone b with template data
* [clsi-cache] limit number of editors per project/user folder to 10
* [web] clone: populate the clsi-cache unless the TeXLive release changed
* [clsi-cache] keep user folder when clearing cache as anonymous user
* [clsi] download old output.tar.gz when synctex finds empty compile dir
* [web] fix lint
* [clsi-cache] multi-zonal lookup of single build output
* [clsi-cache] add more validation and limits
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
* [clsi] do not include clsi-cache tar-ball in output.zip
* [clsi-cache] fix reference after remaining constant
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
* [web] consolidate validation of filename into ClsiCacheHandler
* [clsi-cache] extend metrics and event tracking
- break down most of the clsi metrics by label
- compile=initial - new compile dir without previous output files
- compile=recompile - recompile in existing compile dir
- compile=from-cache - compile using previous clsi-cache
- extend segmentation on compile-result-backend event
- isInitialCompile=true - found new compile dir at start of request
- restoredClsiCache=true - restored compile dir from clsi-cache
* [clsi] rename metrics labels for download of clsi-cache
This is in preparation for synctex changes.
* [clsi] use constant for limit of entries in output.tar.gz
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
* [clsi-cache] fix cloning of project cache
---------
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 4901a65497af13be1549af7f38ceee3188fcf881