Commit Graph

13 Commits

Author SHA1 Message Date
Tom Moor
0856f5f6ae Move template management to settings (#5811) 2023-09-10 12:46:12 -07:00
Tom Moor
ec0564eb32 chore: Test performance (#5786) 2023-09-06 14:19:21 -07:00
Tom Moor
3eb947e9a5 chore: Improve perf of server tests (#5785) 2023-09-06 04:14:49 -07:00
Tom Moor
e347404502 chore: Improvements to document move behavior (#4689)
* chore: Improvements to document move behavior

* test
2023-01-12 18:48:09 -08:00
Tom Moor
1fbc000e03 chore: Reduce test boilerplate (#4300)
* chore: Reduce test boilerplate

* mo
2022-10-15 19:40:21 -07:00
Apoorv Mishra
0c51bfb899 perf: reduce memory usage upon running server tests (#3949)
* perf: reduce memory usage upon running server tests

* perf: plug leaks in server/routes

* perf: plug leaks in server/scripts

* perf: plug leaks in server/policies

* perf: plug leaks in server/models

* perf: plug leaks in server/middlewares

* perf: plug leaks in server/commands

* fix: missing await on db.flush

* perf: plug leaks in server/queues

* chore: remove unused legacy funcs

* fix: await on db.flush

* perf: await on GC to run in between tests

* fix: remove db refs

* fix: revert embeds

* perf: plug leaks in shared/i18n
2022-08-11 21:39:17 +05:30
Tom Moor
e5b524e4c2 chore: Upgrade sequelize dependency 2022-06-06 21:54:54 +02:00
Corey Alexander
2449434fef feat: Allow Document to be fetched without Slug (#3453)
* Allow Document to be fetched without Slug

Fixes #3423

This PR refactors the `Document.findByPk` method to not require the
`slug` portion of the urlID.

Before this function accepted two different 'formats' for the ID.

 - The `uuid` ID of the Document
 - The full `urlID` which looked something like
   `some-document-1234567890`

However the `some-document` slug portion of this identifier wasn't
actually used when looking for a document.

We now allow searching by JUST the postfix of the `urlID`, in the above
example that is `1234567890`.
We do this via a new Regex pattern to match on that just looks for the
right looking id alone, without the prefix.

This codepath looks the same as when we find it by the full `urlID`
besides the different regex that we match on.

The issue #3423 mentions that this should apply to all the API
endpoints. I believe that this `findByPk` method is all that should be
needed for that change. But if this is incorrect, OR you would like more
test coverage on the API endpoints as a more 'end to end test' please
let me know!

* Change original regex to make the slug optional

This has the, I believe to be good, side-effect of making the same logic
apply to `Collection` as well. Since `Collection` was always doing the
same stripping of the slug before the lookup I believe it should be just
as safe to do there.

We don't have to touch the code in Collections but we add a test of this
behavior there as well.

* No reason to rename this now that we aren't doing two matches
2022-04-26 20:49:37 -07:00
Nan Yu
096b35e08e chore: change the way that share permissions are checked on child documents to use the parentId field of documents rather than the collection structure (#3294) 2022-03-28 10:18:59 -07:00
Nan Yu
71820fb3ad feat: Add navigation sidebar to shared documents (#2899)
Co-authored-by: Tom Moor <tom@getoutline.com>
2022-01-14 19:02:01 -08:00
Tom Moor
c6cc04cad8 chore: More typescript FIXME's removed 2022-01-06 21:25:42 -08:00
Tom Moor
b20a341f0c chore: Typescript database models (#2886)
closes #2798
2022-01-06 18:24:28 -08:00
Tom Moor
15b1069bcc chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.

closes #1282
2021-11-29 06:40:55 -08:00