Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds transfers between stores to external attachments #1358

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8342a4c
Adds "delete" operator to attachment stores
Spoffy Dec 17, 2024
a0cc24c
Enables updating of file info
Spoffy Dec 18, 2024
b62bab8
Incremental refactoring towards transfers
Spoffy Dec 30, 2024
76db9e5
Adds functioning transfers of individual files
Spoffy Dec 30, 2024
8b23319
Adds test for attachment file corruption on transfer
Spoffy Dec 30, 2024
71f1314
Adds additional check to file transfer
Spoffy Dec 31, 2024
a9d36d3
Adds attachment transfer queue and job
Spoffy Dec 31, 2024
382847d
Adds test for all files being transferred
Spoffy Dec 31, 2024
011e5d1
Adds test for recent transfers taking priority
Spoffy Dec 31, 2024
c53c016
Adds test for recent transfer requests taking precedence
Spoffy Jan 2, 2025
7e34d8f
Updates an existing all files transfer if possible
Spoffy Jan 3, 2025
2addc2f
Adds location summary function and misc behaviour tweaks
Spoffy Jan 4, 2025
6de387c
Cleans up transfer logic and adds doc endpoint ID.
Spoffy Jan 4, 2025
7c0ee63
Fixes test compilation problem
Spoffy Jan 6, 2025
a44944a
Removes TODO from _performPendingTransfers
Spoffy Jan 6, 2025
d10ba26
Makes transfer code more understandable
Spoffy Jan 7, 2025
cbaf592
Fixes an inconsistent import
Spoffy Jan 7, 2025
1ffeb45
Fixes a linter issue
Spoffy Jan 8, 2025
ca0ee2d
Improves several checks
Spoffy Jan 14, 2025
d721c79
Splits findOrAttach file into 2 functions
Spoffy Jan 14, 2025
7153b44
Fixes issue with transfer job not type safety
Spoffy Jan 14, 2025
e1c9a8d
Renames "findOrAttachFile" to "attachFileIfNew"
Spoffy Jan 14, 2025
586d5a4
Switches "UNIQUE" constraint check to a "SELECT"
Spoffy Jan 14, 2025
220e6f9
Splits getFileInfo into two functions
Spoffy Jan 14, 2025
83d984e
Splits AttachmentFileManager._addFile into two functions
Spoffy Jan 14, 2025
fdc3fa4
Rephrases a comment
Spoffy Jan 14, 2025
2dc01d0
Fixes a failing AttachmentFileManager test
Spoffy Jan 14, 2025
34ac344
Revert "Switches "UNIQUE" constraint check to a "SELECT""
Spoffy Jan 15, 2025
337c128
Adds a comment explaining why UNIQUE constraint is caught.
Spoffy Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/server/lib/ActiveDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,26 @@ export class ActiveDoc extends EventEmitter {
return data;
}

public async startTransferringAllAttachmentsToDefaultStore() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unusually long name for this codebase, but very clear, so 👍

const attachmentStoreId = (await this._getDocumentSettings()).attachmentStoreId;
// If no attachment store is set on the doc, it should transfer everything to internal storage
await this._attachmentFileManager.startTransferringAllFilesToOtherStore(attachmentStoreId);
}

/**
* Returns a summary of pending attachment transfers between attachment stores.
*/
public attachmentTransferStatus() {
return this._attachmentFileManager.transferStatus();
}

/**
* Returns a summary of where attachments on this doc are stored.
*/
public async attachmentLocationSummary() {
return await this._attachmentFileManager.locationSummary();
}

/**
* Fetches the meta tables to return to the client when first opening a document.
*/
Expand Down
Loading
Loading