gristlabs_grist-core/app/server/lib
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
..
ACLFormula.ts
ActionHistory.ts
ActionHistoryImpl.ts
ActionSummary.ts
ActiveDoc.ts (core) Crudely show row count and limit in UI 2022-03-14 21:49:32 +02:00
ActiveDocImport.ts (core) Fix error when canceling import 2022-03-10 16:24:49 -08:00
AppEndpoint.ts (core) make Grist easier to run with a single server 2022-03-05 13:30:45 -05:00
Authorizer.ts style fixes 2022-03-14 17:51:10 +01:00
BrowserSession.ts (core) add a user.SessionID value for trigger formulas and granular access rules 2022-02-22 12:50:43 -05:00
checksumFile.ts
Client.ts (core) add a user.SessionID value for trigger formulas and granular access rules 2022-02-22 12:50:43 -05:00
Comm.js style fixes 2022-03-14 17:51:10 +01:00
dbUtils.ts
DiscourseConnect.ts
DocApi.ts (core) add grist.selectedTable.create/update/destroy/upsert to custom widget api 2022-03-15 11:11:58 -04:00
DocClients.ts
DocManager.ts (core) Crudely show row count and limit in UI 2022-03-14 21:49:32 +02:00
DocPluginData.ts
DocPluginManager.ts
DocSession.ts (core) add a user.SessionID value for trigger formulas and granular access rules 2022-02-22 12:50:43 -05:00
DocSnapshots.ts (core) Prune snapshots outside the window in product features 2022-03-18 18:48:14 +02:00
DocStorage.ts (core) More accurate data size measurement 2022-03-09 12:04:16 +02:00
DocStorageManager.ts
docUtils.d.ts
docUtils.js
DocWorker.ts (core) forbid use of sqlite ATTACH except during VACUUM 2022-03-14 09:34:44 -04:00
DocWorkerMap.ts
ExcelFormatter.ts
ExpandedQuery.ts
Export.ts
ExportCSV.ts
ExportXLSX.ts
expressWrap.ts
ExternalStorage.ts
extractOrg.ts
FileParserElement.ts
filterUtils.ts
FlexServer.ts (core) Record new user sign-ups 2022-03-12 14:34:46 -08:00
GoogleAuth.ts
GoogleExport.ts
GoogleImport.ts
GranularAccess.ts (core) Crudely show row count and limit in UI 2022-03-14 21:49:32 +02:00
GristServer.ts (core) Add Grist forgot password page 2022-03-07 09:11:28 -08:00
gristSessions.ts
guessExt.ts
HashUtil.ts
HostedMetadataManager.ts
HostedStorageManager.ts (core) Prune snapshots outside the window in product features 2022-03-18 18:48:14 +02:00
IBilling.ts
IChecksumStore.ts
ICreate.ts
IDocStorageManager.ts
idUtils.ts
IElectionStore.ts
initialDocSql.ts
INotifier.ts
ISandbox.ts
IShell.ts
ITestingHooks-ti.ts (core) be careful when reassigning a doc to a worker it was on before 2022-03-08 17:20:01 -05:00
ITestingHooks.ts (core) be careful when reassigning a doc to a worker it was on before 2022-03-08 17:20:01 -05:00
log.ts
LogMethods.ts
manifest.ts
MinimalLogin.ts (core) make Grist easier to run with a single server 2022-03-05 13:30:45 -05:00
NSandbox.ts
OnDemandActions.ts
PermissionInfo.ts
Permit.ts
places.ts
PluginEndpoint.ts
PluginManager.ts
reportTimeTaken.ts
requestUtils.ts (core) Add Grist forgot password page 2022-03-07 09:11:28 -08:00
RowAccess.ts
SafePythonComponent.ts
SamlConfig.ts Fix typo in email fallback for SAML 2022-02-20 02:39:30 -08:00
SandboxControl.ts
sandboxUtil.js
sendAppPage.ts (core) Record new user sign-ups 2022-03-12 14:34:46 -08:00
ServerColumnGetters.ts
ServerLocale.ts
serverUtils.ts
Sessions.ts (core) make Grist easier to run with a single server 2022-03-05 13:30:45 -05:00
Sharing.ts (core) Crudely show row count and limit in UI 2022-03-14 21:49:32 +02:00
shortDesc.ts
shutdown.js
SQLiteDB.ts (core) forbid use of sqlite ATTACH except during VACUUM 2022-03-14 09:34:44 -04:00
TableMetadataLoader.ts
TagChecker.ts
TestingHooks.ts (core) be careful when reassigning a doc to a worker it was on before 2022-03-08 17:20:01 -05:00
TestLogin.ts
Throttle.ts
TimeQuery.ts
Triggers.ts
UnsafeNodeComponent.ts
uploads.ts (core) make Grist easier to run with a single server 2022-03-05 13:30:45 -05:00
WidgetRepository.ts
WorkCoordinator.ts