From 83a4dd1fbc37606cdf4d613f51b2c8d6789dff01 Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Thu, 20 Jun 2024 11:13:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20DriveFile:=20add=20edit?= =?UTF-8?q?ing=5Fsession=5Fkey=20column=20(#525)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/services/documents/entities/drive-file.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tdrive/backend/node/src/services/documents/entities/drive-file.ts b/tdrive/backend/node/src/services/documents/entities/drive-file.ts index a379d310e..b856d5c8a 100644 --- a/tdrive/backend/node/src/services/documents/entities/drive-file.ts +++ b/tdrive/backend/node/src/services/documents/entities/drive-file.ts @@ -35,6 +35,10 @@ export type DriveScope = "personal" | "shared"; globalIndexes: [ ["company_id", "parent_id"], ["company_id", "is_in_trash"], + + // Needs to be globally unique (no `company_id`) because it's the only key that OnlyOffice + // will return to us to identify the document being edited. Convenient for other plugins too. + ["editing_session_key"], ], primaryKey: [["company_id"], "id"], type: TYPE, @@ -87,6 +91,15 @@ export class DriveFile { @Column("access_info", "encoded_json") access_info: AccessInformation; + /** + * If this field is non-null, then an editing session is in progress (probably in OnlyOffice). + * Should be in the format `appid-timestamp-hexuuid` where `appid` and `timestamp` have no `-` + * characters. + */ + @Type(() => String) + @Column("editing_session_key", "string") + editing_session_key: string; + @Type(() => String) @Column("content_keywords", "string") content_keywords: string;