Commit graph

630 commits

Author SHA1 Message Date
Jakob Ackermann
b1880ba64d [monorepo] upgrade tough-cookie in request to latest version (#27249)
GitOrigin-RevId: 9096e05d2c337c3d3a9b4ca6efec8fd40c51a622
2025-07-22 08:07:08 +00:00
Andrew Rumble
f054a5658f Run npm install with new npm version
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 8d81e73f528c34ad8df8b09716198dbaeebee23f
2025-07-18 08:05:33 +00:00
Jakob Ackermann
8c39add865 [clsi-cache] meter ingress and egress bandwidth (#27143)
* [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
2025-07-16 08:05:59 +00:00
Andrew Rumble
8a5e2b0ea3 Update package-lock file
This step is required as renovate is not able to generate a lockfile
itself

GitOrigin-RevId: d5fcdc4a98b24c6fb5662ef77dac6a1cf47589c2
2025-07-09 08:05:31 +00:00
renovate[bot]
6176f4d074 Update linters
GitOrigin-RevId: e6ce5461881abe515f57b9b066bb81c194f80e53
2025-07-09 08:05:22 +00:00
Andrew Rumble
f5038b5de3 Switch eslint-plugin-n for eslint-plugin-node
GitOrigin-RevId: eec3cf3836556a5c035b1339548c724ab3cd0c43
2025-07-04 08:04:56 +00:00
Andrew Rumble
381a106b46 Remove @types/workerpool
This is a stub

GitOrigin-RevId: de776c11044c42bb191424f1d614442da22c3197
2025-07-04 08:04:51 +00:00
Andrew Rumble
90226043c7 Remove @types/react-bootstrap
GitOrigin-RevId: 0a410b82540b2b11bc4930753dbd650937ebba1e
2025-07-04 08:04:46 +00:00
Alf Eaton
97863f62ca Upgrade TypeScript to 5.8.3 (#24900)
GitOrigin-RevId: 80937de3dde14e21e02af2ecb93350b1fedafc82
2025-07-03 08:05:57 +00:00
Andrew Rumble
fe5d6ddf5c Upgrade cross-env
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
2025-07-01 08:05:48 +00:00
Antoine Clausse
46555d27b0 [web] Add window. prefix to globals and add no-restricted-globals rule (#26422)
* 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
2025-06-24 08:05:10 +00:00
Rebeka Dekany
c40ab3234d Prettier for PUG templates (#26170)
* Setup prettier

* Ignore these pug templates by prettier

* Fix typo

* Fix prettier error

* Add prettier-ignore for quoting of event-segmentation attribute

* Manual tab indentation

* Interpolate

* Remove unbuffered if conditional

* Inline event-segmentation objects and remove prettier-ignore rule

* Fix spacing before interpolation

* Source format

* Source format

GitOrigin-RevId: c30e037f5caf8f91efc1bd9e75f81ae533b5a506
2025-06-24 08:05:06 +00:00
Eric Mc Sween
9cb4ef4d7d Merge pull request #26353 from overleaf/bg-history-redis-extend-persist-worker
extend persist worker to make parallel requests

GitOrigin-RevId: 8def7d5a8b5c9fcbe5fe45ac8f3ace503d31877a
2025-06-17 08:05:55 +00:00
Jakob Ackermann
6f516b25af [project-history] add metrics for compression of updates (#26307)
* [project-history] add metrics for compression of updates

* [project-history] sample compression metrics

GitOrigin-RevId: 1cd67dc4ec7b44285afb436c62392b464f007f97
2025-06-16 08:06:28 +00:00
Jakob Ackermann
25c3699862 [docstore] finish async/await migration (#26295)
* [docstore] DocManager.getDocLines returns flat content

* [docstore] peekDoc throws NotFoundError, skip check in HttpController

* [docstore] getFullDoc throws NotFoundError, skip check in HttpController

* [docstore] migrate HealthChecker to async/await

* [docstore] migrate HttpController to async/await

* [docstore] remove .promises/callbackify wrapper from all the modules

GitOrigin-RevId: a9938b03cdd2b5e80c2c999039e8f63b20d59dc5
2025-06-11 08:07:20 +00:00
Miguel Serrano
5b08adc4ff Merge pull request #26218 from overleaf/msm-bump-tar-fs-multer
[clsi/web/history-v1] Bump `tar-fs` and `multer`

GitOrigin-RevId: c76b964224c8367d68dc1190ff29627cc6919ade
2025-06-10 08:06:05 +00:00
Kristina
9ba772b18f [web] handle 3DS challenges for Stripe (#25918)
* 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
2025-06-02 08:05:16 +00:00
Andrew Rumble
a06ae82b56 Remove esmock from web
GitOrigin-RevId: 32aa3f23da8bb135d41f2e305662f157094d4936
2025-05-29 08:06:46 +00:00
Andrew Rumble
0d3025b8cf Add vitest and configuration
GitOrigin-RevId: 1262f9f32a0db6a29d3feedd8158b8dd04e48b6a
2025-05-29 08:04:55 +00:00
Miguel Serrano
88d3186dc1 Merge pull request #25792 from overleaf/msm-bump-multer
Bump `multer` to v2.0.0

GitOrigin-RevId: 688bfd3e6546b18f22ebaef82e4d9dd57b6d40bd
2025-05-22 08:45:16 +00:00
Jessica Lawshe
6bc4e40773 Merge pull request #24624 from overleaf/jel-latexqc-updates
[LaTeXQC] Footer and other minor style updates

GitOrigin-RevId: 67a43f715857a3bd1e97f24278d8e4586815688c
2025-05-21 08:05:50 +00:00
Alf Eaton
f7d37a49d6 Upgrade CodeMirror dependencies (#25620)
* Upgrade CodeMirror dependencies
* Upgrade Lezer dependencies

GitOrigin-RevId: fcbf9b4bbf2577d85f44b48d3b745a56e49e24c9
2025-05-19 12:27:19 +00:00
Miguel Serrano
a8b443fe5f [web] Update base-x dependency to 4.0.1 (#25581)
GitOrigin-RevId: 746f06a3abe75dbc7deb6ea181a15dfc24cd9d22
2025-05-19 12:26:43 +00:00
Andrew Rumble
586820c34d Fix package version for socket.io
GitOrigin-RevId: 07a436ce0db5a0cd320964e3e9e7a5646877561b
2025-05-19 08:05:29 +00:00
Andrew Rumble
daa52d62fa Allow an empty origin request in real-time
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
2025-05-19 08:05:16 +00:00
Tim Down
5c4cb50628 Merge pull request #24988 from overleaf/td-bs5-upgrade-and-rename
Apply minor upgrades to Bootstrap 5 and react-bootstrap

GitOrigin-RevId: eb013f38515ebd4b9572d139f00841aca344e3c6
2025-05-16 08:05:28 +00:00
Alf Eaton
b70e0166bd Remove zlib dependency from freegeoip (#25474)
GitOrigin-RevId: 9f61a0630ff6c4b7fd92f180fb58f91178567ede
2025-05-14 08:06:26 +00:00
Jakob Ackermann
e8b5ee2ff9 [history-ot] initial implementation of using doc-level history-ot (#25054)
* [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
2025-05-08 08:05:44 +00:00
Antoine Clausse
eddeca2942 [history-v1] Update config from 1.31.0 to 3.3.12 (#25077)
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
2025-05-07 08:07:56 +00:00
Antoine Clausse
81941ff335 Update some dependencies so they're compatible with Node 22 (#25317)
* `"@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
2025-05-07 08:06:57 +00:00
M Fahru
c8a410d358 Merge pull request #25155 from overleaf/mf-use-stripe-v18
[web] Upgrade stripe to v18

GitOrigin-RevId: df522f73132e99e38f1716bf33e8ff4881bd5430
2025-05-06 08:05:19 +00:00
Tim Down
7abafb01ea Merge pull request #23940 from overleaf/td-react-18
Upgrade to React 18

GitOrigin-RevId: 9b81936e6eea2bccd97fe5c2c5841f0b946371b8
2025-05-02 08:05:29 +00:00
Jakob Ackermann
7256c99e29 [clsi-cache] scale writes (#25198)
* [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
2025-05-01 08:05:55 +00:00
Tim Down
5d78229e1e Merge pull request #25093 from overleaf/td-upgrade-react-error-boundary-second-attempt
Upgrade react-error-boundary to version 5, second attempt

GitOrigin-RevId: 2b88334b66f0ace383211c147279ff88e9f956bb
2025-04-29 08:06:23 +00:00
Alf Eaton
247b4e274d Upgrade PDF.js to v5 (#24948)
* Reapply "Upgrade PDF.js to v5 (#24646)" (#24946)
* Upgrade core-js, caniuse-lite and babel

GitOrigin-RevId: 63398189301b5f5adc8a17b332d92dccfc26d612
2025-04-28 08:05:09 +00:00
Tim Down
cf36767f03 Merge pull request #25080 from overleaf/revert-25073-td-upgrade-react-error-boundary
Revert "Upgrade react-error-boundary to version 5"

GitOrigin-RevId: 3301adb508eed26e4429c6aa912abf9e81c1d9f8
2025-04-25 08:05:25 +00:00
Tim Down
247f04557c Merge pull request #25073 from overleaf/td-upgrade-react-error-boundary
Upgrade react-error-boundary to version 5

GitOrigin-RevId: ebccd35e10084aa221c437c09ddfdb86f6272cf3
2025-04-25 08:05:20 +00:00
Tim Down
fb50d429b4 Merge pull request #24965 from overleaf/td-downshift-9-upgrade
Upgrade Downshift to version 9

GitOrigin-RevId: b36904ab0c82c09a633a25cd6fed651d7c8b19f7
2025-04-24 08:06:24 +00:00
Antoine Clausse
8ec9cd21b4 [latexqc] Update vite version (#25056)
Fixes https://github.com/overleaf/internal/security/dependabot/1398

GitOrigin-RevId: e759d529609df79c63e0c6c45cda941d45fe7ec8
2025-04-24 08:06:19 +00:00
Antoine Clausse
5861e4160c [latexqc] Continue the ESM migration (#24743)
* 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
2025-04-24 08:06:14 +00:00
Andrew Rumble
1c672e55f5 Minor bump of webpack and @pmmmwh/react-refresh-webpack-plugin
GitOrigin-RevId: 55421a1cd66e0ec7177470f38fe9f575837b6bac
2025-04-23 08:05:11 +00:00
Antoine Clausse
b901bb6c75 [web] Update fetch-mock to version 12 (#24837)
* Update fetch-mock to version 12

* Replace `fetchMock.done` by `fetchMock.callHistory.done`

* Replace `…Mock.called` by `…Mock.callHistory.called`

* Replace `fetchMock.reset` by `fetchMock.hardReset`

* Replace `fetchMock.restore` by `fetchMock.hardReset`

* Replace `fetchMock.resetHistory` by `fetchMock.clearHistory`

* Replace `fetchMock.calls` by `fetchMock.callHistory.calls`

* Replace `fetchMock.flush` by `fetchMock.callHistory.flush`

* Update tests for fetch-mock version 12

See https://www.wheresrhys.co.uk/fetch-mock/docs/Usage/upgrade-guide

* Update stories for fetch-mock version 12

* Remove `overwriteRoutes` option

* Add `fetchMock.spyGlobal()` to storybook

* Remove deprecated `sendAsJson` param

* Replace `fetchMock.hardReset()` by `fetchMock.removeRoutes().clearHistory()`

* Fixup fetch-mock in storybook:

Call `mockGlobal` inside the hook, call `removeRoutes` and `unmockGlobal` on cleanup

Behaviour can be tested by navigating between

https://storybook.dev-overleaf.com/main/?path=/story/editor-ai-error-assistant-compile-log-entries--first-log-entry
https://storybook.dev-overleaf.com/main/?path=/story/editor-ai-error-assistant-compile-log-entries--rate-limited

https://storybook.dev-overleaf.com/main/?path=/story/project-list-notifications--project-invite
https://storybook.dev-overleaf.com/main/?path=/story/project-list-notifications--project-invite-network-error

And clicking the buttons

GitOrigin-RevId: 35611b4430259e4c21c3d819ad18b2e6dab66242
2025-04-17 08:06:24 +00:00
Antoine Clausse
fa62529d82 [clsi] Replace diskusage by fs (#24789)
* 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
2025-04-17 08:06:16 +00:00
Alf Eaton
34d5564abc Revert "Upgrade PDF.js to v5 (#24646)" (#24946)
This reverts commit 3ef46af6363aab5b5b007b6c9d72decae65a36ab.

GitOrigin-RevId: 9c3671b3ff196bb62ff547210a1138cb603d6791
2025-04-17 08:05:15 +00:00
Alf Eaton
a1098a921c Upgrade PDF.js to v5 (#24646)
GitOrigin-RevId: 3ef46af6363aab5b5b007b6c9d72decae65a36ab
2025-04-17 08:04:59 +00:00
Tim Down
773cbc92eb Merge pull request #24592 from overleaf/td-socket-io-origins
Use updated socket.io with CORS origin check in real-time

GitOrigin-RevId: a1a874ba298e145aa4c9dd55ef723d79843f8145
2025-04-15 08:05:25 +00:00
Jakob Ackermann
b538d56591 [clsi-cache] backend (#24388)
* [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
2025-04-10 08:05:17 +00:00
Tim Down
28468e134c Merge pull request #24660 from overleaf/td-bs5-remove-react-bootstrap-0
Remove react-bootstrap 0.33.1

GitOrigin-RevId: c320a6b18c576afdc0fd49559915d3d2f3a7a1ef
2025-04-10 08:04:50 +00:00
Jakob Ackermann
cdf04d695c [clsi] upgrade dockerode to bump tar-fs (#24693)
Diff: https://github.com/apocas/dockerode/compare/v3.3.1...v4.0.5
GitOrigin-RevId: 73ba2610d0c2e766a52e638754af410aaad94ec1
2025-04-08 08:06:23 +00:00
Brian Gough
6969a12fae Merge pull request #24616 from overleaf/bg-npm-audit-fix
update axios to version 1.8.4

GitOrigin-RevId: 0e7deb1b55b08ad1c1d81fdd2fa96925b514caf7
2025-04-02 08:04:59 +00:00