gristlabs_grist-core/app/gen-server/entity
Alex Hall ec8460b772 (core) Prune snapshots outside the window in product features
Summary:
- Add a method `getSnapshotWindow` to `IInventory` and `DocSnapshotInventory`. It returns a `SnapshotWindow`, which represents a duration of time for which we keep backups for a particular document.
- `DocSnapshotPruner` calls this method and passes the window to `shouldKeepSnapshots` to determine which document versions have fallen outside the window and should be pruned.
- The implementation passed to `DocSnapshotInventory` uses a new method `getDocProduct` in `HomeDBManager` which directly returns the `Product` associated with a document, given only the document ID. Other methods in `HomeDBManager` require passing more information, especially about a user, but `DocSnapshotPruner` only knows about document IDs.

Test Plan: Added a test for `getDocProduct` and a test for `DocSnapshotPruner` where `getSnapshotWindow` is specified.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3322
2022-03-18 18:48:14 +02:00
..
AclRule.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
Alias.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
BillingAccount.ts (core) add appsumo endpoints with stub implementations 2021-06-21 16:04:33 -04:00
BillingAccountManager.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
Document.ts (core) Initial webhooks implementation 2021-09-23 14:35:39 +02:00
Group.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
Login.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
Organization.ts (core) add per-user per-org preferences to database 2020-08-04 15:20:13 -04:00
Pref.ts (core) add per-user per-org preferences to database 2020-08-04 15:20:13 -04:00
Product.ts (core) Prune snapshots outside the window in product features 2022-03-18 18:48:14 +02:00
Resource.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
Secret.ts (core) Initial webhooks implementation 2021-09-23 14:35:39 +02:00
User.ts (core) Add account page option to allow Google login 2022-02-14 16:56:23 -08:00
Workspace.ts (core) move home server into core 2020-07-21 20:39:10 -04:00