From 8e712eacf503ad3c39dce472526d852fcf29734a Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 21 Jun 2021 21:31:40 +0100 Subject: [PATCH] Fixed tsc build --- packages/server/schema.sqlite | Bin 290816 -> 290816 bytes packages/server/src/db.ts | 2 +- packages/server/src/models/ChangeModel.ts | 7 ++++--- packages/server/src/tools/generateTypes.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/server/schema.sqlite b/packages/server/schema.sqlite index f7e871b4bf3bf42d78981716231f48e8f19fbabb..061ec0fe73ecfa85be3f5877fb5c793426f5dd69 100644 GIT binary patch delta 761 zcmZp8AlUFgaKjc^76Zparzh`_)dn$+O@1z`2x1(X%p<1?VjP%kDyI%&?4Fz;2bS7C zxm8XDB(i4mS~-0XW98%ravC7UvdKL1V8ywU&E?gZfg+O=&=RN}=A2(#loV;68tfU81k<_QxcGtn39{B=a7@1 zoS2i5UtFSMl&E58pps#j=4s+&nic5bWai?PVN&i{6<${AoKcXH>z-fbUl1PPuUG04 zZk~~6?5%I+>K$HInC9*XGK#Uv!13S>2+763u$ejFF24dHM{EjsK!l=#n*9kbhK6Ou zW`RaYSz+0ZQHhqJWx0jL72bw!iQxsQfmvyUY$Bw8y2D#W2_9rmfZaw&8&Qh31uz1= zNyw;e35+}P6?`L8D}4f!0(~;gi*mBP^2)t(QnJm9T}+dFqAV?4&8Ocu&nU-*2x_nc q2x;2(fboGmL8BKp)nOB}?5ozw}6p~?4m1kfYnUt8AlAD?5kdvRB zn3IuTT%ux>sA6cKQea|M80>7|?p)++;hR*ZpXr&Y@2BSx9PE?t9cdbn8JKEplv3*I zub){KRA?R%9`5bs>+J|Kim^(6=fZywl8b?1GjqUQeg#5~*c9-92t@@o`x7!N@{E%# zbKPCcoeE5xBRon|Lk*3REVGhbd@Bkp(p?DIL`eU1hqsIpJjk8^yN!@Gq7-clU<7)T zkWt$b7nmYM~=bB|3OuuoSQH~1{)L;h? p(zNXX;{$nuMlYIRuxNq8rUl#r+qn~%uErCLy|x2P%MLJa003Wa41E9q diff --git a/packages/server/src/db.ts b/packages/server/src/db.ts index f0c13fb7f..ddde737c7 100644 --- a/packages/server/src/db.ts +++ b/packages/server/src/db.ts @@ -357,7 +357,7 @@ export interface Item extends WithDates, WithUuid { jop_share_id?: Uuid; jop_type?: number; jop_encryption_applied?: number; - jop_updated_time?: string; + jop_updated_time?: number; } export interface UserItem extends WithDates { diff --git a/packages/server/src/models/ChangeModel.ts b/packages/server/src/models/ChangeModel.ts index 1c165952c..ef3bf4190 100644 --- a/packages/server/src/models/ChangeModel.ts +++ b/packages/server/src/models/ChangeModel.ts @@ -160,9 +160,10 @@ export default class ChangeModel extends BaseModel { const items: Item[] = await this.db('items').select('id', 'jop_updated_time').whereIn('items.id', changes.map(c => c.item_id)); - let finalChanges: DeltaChange[] = this.compressChanges(changes); - finalChanges = await this.removeDeletedItems(finalChanges, items); - finalChanges = finalChanges.map(c => { + let processedChanges = this.compressChanges(changes); + processedChanges = await this.removeDeletedItems(processedChanges, items); + + const finalChanges: DeltaChange[] = processedChanges.map(c => { const item = items.find(item => item.id === c.item_id); if (!item) return c; return { diff --git a/packages/server/src/tools/generateTypes.ts b/packages/server/src/tools/generateTypes.ts index c95b29af7..9a9719272 100644 --- a/packages/server/src/tools/generateTypes.ts +++ b/packages/server/src/tools/generateTypes.ts @@ -42,6 +42,7 @@ const propertyTypes: Record = { 'notifications.level': 'NotificationLevel', 'shares.type': 'ShareType', 'items.content': 'Buffer', + 'items.jop_updated_time': 'number', 'share_users.status': 'ShareUserStatus', 'emails.sender_id': 'EmailSender', 'emails.sent_time': 'number',