Commit graph

144 commits

Author SHA1 Message Date
Jakob Ackermann
7f9fd00bda Merge pull request #5367 from overleaf/jpa-node-handle-callback-err
[misc] fix eslint violations for node/handle-callback-err

GitOrigin-RevId: 83a4900e8861010df1917bff49382bd9c93375bd
2021-10-28 08:03:26 +00:00
Brian Gough
4688cb7b54 Merge pull request #5575 from overleaf/bg-improve-undelete-doc-admin-page
add deletedAt timestamp to undelete doc admin page

GitOrigin-RevId: 46893aae35290e42886320731a5f68811fb3ed46
2021-10-27 08:03:29 +00:00
Brian Gough
9c50a2488f remove decaff headers, fix camelcase 2021-08-03 10:12:16 +01:00
Brian Gough
9a14d01517 remove decaff headers 2021-08-03 10:12:00 +01:00
Brian Gough
43cab1fddc remove unnecessary returns and callbacks 2021-08-03 10:08:17 +01:00
Brian Gough
8c791b2938 remove default callback 2021-08-03 10:07:00 +01:00
Brian Gough
942feb3011 move process.env.BACKEND to setup.js 2021-08-03 10:00:44 +01:00
Brian Gough
04ea24dfbc remove decaf header and fix lint issues 2021-08-03 09:39:24 +01:00
Brian Gough
8afdc8cbd4 add unit test for withRevCheck method 2021-08-02 11:36:43 +01:00
Brian Gough
50fa9609a3 add test of archive status 2021-08-02 11:01:30 +01:00
Brian Gough
69339aeb9d return the origin of peeked docs 2021-08-02 10:25:03 +01:00
Brian Gough
6ce28271eb peek at docs without unarchiving 2021-07-30 16:06:16 +01:00
Jakob Ackermann
540b52c128 [misc] run format_fix and lint:fix 2021-07-13 12:04:48 +01:00
Jakob Ackermann
2c35adaf48 [misc] switch from settings-sharelatex to @overleaf/settings 2021-07-12 17:47:20 +01:00
Jakob Ackermann
d69c29e4dc [misc] apply review feedback on naming functions and parameters
Co-Authored-By: Simon Detheridge <s@sd.ai>
2021-06-08 19:29:10 +01:00
Jakob Ackermann
4996f8bbcd [DocArchiveManager] (un-)archive docs in batches and let db filter docs
Also drop the broken 404 logic after switching to db-side filtering.
2021-06-08 12:59:13 +01:00
Jakob Ackermann
9ba8237850 [DocArchiveManager] retry the deletion of doc archives three times 2021-05-05 10:58:33 +01:00
Jakob Ackermann
54c6cce902 Merge pull request #100 from overleaf/jpa-drop-name-filter
[MongoManager] drop name filter from getProjectsDeletedDocs
2021-04-21 14:38:40 +02:00
Jakob Ackermann
74aaa73ad2 Merge pull request #101 from overleaf/jpa-destroy-in-small-batches
[DocArchiveManager] destroy in small batches
2021-04-16 11:24:04 +02:00
Jakob Ackermann
3f94dd4dbf [DocArchiveManager] destroy in small batches
Also add settings options for PARALLEL_JOBS and DESTROY_BATCH_SIZE.
2021-04-16 09:51:41 +01:00
Jakob Ackermann
5bcd142b6f [MongoManager] drop name filter from getProjectsDeletedDocs
All the doc names we had in the projects collection are back-filled now.
A few docs will get dummy values back-filled.
2021-04-12 17:31:26 +01:00
Jakob Ackermann
e80d013268 [misc] drop the deleteDoc endpoint -- use patchDoc instead 2021-04-12 17:31:18 +01:00
Eric Mc Sween
5efae3bee6 Add a global test setup file
Configure chai and SandboxedModule globally instead of in every test
file. Also add globals that are required for SandboxedModule to work in
Node 12.
2021-03-16 08:41:46 -04:00
Jakob Ackermann
8915e1d026 [misc] add a new endpoint for getting deleted docs 2021-02-18 10:10:14 +00:00
Jakob Ackermann
0c169cb242 [HttpController] double down on request validation 2021-02-17 11:31:27 +00:00
Jakob Ackermann
26bc074098 [DocstoreManager] patchDoc: allow updates after deletion 2021-02-17 11:31:01 +00:00
Jakob Ackermann
dd4f4057f4 [misc] add a new endpoint for changing a docs meta data -- incl. deleted
- Validate the request payload with joi -- includes acceptance tests.
- Reject updates to docs that have been deleted.
2021-02-15 13:13:48 +00:00
Jakob Ackermann
12bef53645 [DocArchiveManager] optionally do not un-archive soft deleted docs 2021-02-09 11:20:26 +00:00
Jakob Ackermann
708bdfd197 [DocManager] optionally flush docs out of mongo when deleting them 2021-02-09 11:17:46 +00:00
Jakob Ackermann
2cf9ff7b41 Merge pull request #89 from overleaf/jpa-is-doc-deleted
[misc] add a new endpoint for querying the deleted status of a doc
2021-02-09 11:14:28 +00:00
Jakob Ackermann
28b1ad3243 [misc] add a new endpoint for querying the deleted status of a doc
`/project/:project_id/doc/:doc_id/deleted` responds with:

- 404: the doc does not exist
- 200 and body `{"deleted":true}`: doc exists and is deleted
- 200 and body `{"deleted":false}`: doc exists and is not deleted
2021-01-15 14:49:27 +00:00
Jakob Ackermann
9298f486ad [app] add a new route for archiving a single doc
There is a minor opportunity for optimizing the mongo call(s) for
 archiving: we should include `{ inS3: false }` in the queries instead
 of filtering locally. It's been like that for years now, so it can
 stay a little longer.
2021-01-04 13:47:55 +00:00
Simon Detheridge
31c757cce2 Don't throw 404 errors when unarchiving, if the doc is already unarchived 2020-09-25 09:17:01 +01:00
Jakob Ackermann
b37e27f023 [misc] run the codemod for moving mongo projections into options 2020-09-17 15:40:20 +01:00
Jakob Ackermann
8a8a830ad3 [misc] simplify mongodb collection access using a shared db construct
Resolve the getCollection Promises once and store the result in a shared
 `db` object which can get imported by all the call-sites.

The http server is starting only after a Promise of `waitForDb()`
 resolves. This covers the app code and the acceptance tests.
2020-09-17 15:39:44 +01:00
Simon Detheridge
ad4531ff01 Upgrade metrics to @overleaf/metrics' 2020-09-10 18:07:14 +01:00
Jakob Ackermann
2fa09928ee [misc] migrate acceptance tests to the native mongo driver, drop mongojs 2020-08-25 09:41:23 +01:00
Jakob Ackermann
df0747ec48 [misc] migrate the app to the native mongo driver
acceptance tests to follow in a separate commit
2020-08-25 09:40:59 +01:00
Simon Detheridge
a18146612a Remove unhandled-promise-rejection handler 2020-07-31 16:25:33 +01:00
Simon Detheridge
9724407e31 Export .promises from MongoManager 2020-07-31 16:20:07 +01:00
Simon Detheridge
04ae868fe2 Update unit tests for object-persistor 2020-07-23 19:43:51 +01:00
Simon Detheridge
e302c1d844 Update acceptance tests for object-persistor and gcs 2020-07-23 19:43:33 +01:00
Simon Detheridge
287d705671 Update buildscripts to use fake-gcs instead of S3 credentials 2020-07-23 19:30:13 +01:00
Ersun Warncke
06ec5556b0 [misc] fix express deprecations
Co-Authored-By: Jakob Ackermann <jakob.ackermann@overleaf.com>
2020-07-02 14:48:11 +01:00
Tim Alby
c854f1f570 prettier auto-format 2020-05-28 15:20:54 +02:00
Jakob Ackermann
80095785b8 [misc] test/unit: fix process usage for node v12
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
2020-04-20 16:50:51 +02:00
Simon Detheridge
785a6cb544 prettier: convert test/acceptance decaffeinated files to Prettier format 2020-02-17 10:49:20 +00:00
Simon Detheridge
7e131e4c71 decaffeinate: rename test/acceptance/coffee to test/acceptance/js 2020-02-17 10:49:18 +00:00
decaffeinate
1391ae96e7 decaffeinate: Run post-processing cleanups on ArchiveDocsTests.coffee and 6 other files 2020-02-17 10:49:16 +00:00
decaffeinate
73b0bc023f decaffeinate: Convert ArchiveDocsTests.coffee and 6 other files to JS 2020-02-17 10:49:14 +00:00