diff --git a/common/changes/@hcengineering/communication-server/fix-lang-store_2025-10-09-20-59.json b/common/changes/@hcengineering/communication-server/fix-lang-store_2025-10-09-20-59.json new file mode 100644 index 0000000000..e6843ad94f --- /dev/null +++ b/common/changes/@hcengineering/communication-server/fix-lang-store_2025-10-09-20-59.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@hcengineering/communication-server", + "comment": "fix language store", + "type": "patch" + } + ], + "packageName": "@hcengineering/communication-server" +} \ No newline at end of file diff --git a/common/changes/@hcengineering/communication-shared/fix-lang-store_2025-10-09-20-59.json b/common/changes/@hcengineering/communication-shared/fix-lang-store_2025-10-09-20-59.json new file mode 100644 index 0000000000..fe9e168bc9 --- /dev/null +++ b/common/changes/@hcengineering/communication-shared/fix-lang-store_2025-10-09-20-59.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@hcengineering/communication-shared", + "comment": "Fix update patch event apply", + "type": "patch" + } + ], + "packageName": "@hcengineering/communication-shared" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 304fbf93e0..94f4b93ca2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13,13 +13,13 @@ importers: ../../packages/client-query: dependencies: '@hcengineering/communication-query': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../query '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/hulylake-client': specifier: ^0.7.1 @@ -71,13 +71,13 @@ importers: ../../packages/cockroach: dependencies: '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-shared': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../shared '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types postgres: specifier: ^3.4.7 @@ -132,13 +132,13 @@ importers: ../../packages/query: dependencies: '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-shared': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../shared '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/hulylake-client': specifier: ^0.7.1 @@ -196,13 +196,13 @@ importers: ../../packages/rest-client: dependencies: '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-shared': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../shared '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/core': specifier: ^0.7.1 @@ -257,7 +257,7 @@ importers: ../../packages/sdk-types: dependencies: '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/core': specifier: ^0.7.1 @@ -309,16 +309,16 @@ importers: specifier: ^0.7.1 version: 0.7.1 '@hcengineering/communication-cockroach': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../cockroach '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-shared': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../shared '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/core': specifier: ^0.7.1 @@ -391,10 +391,10 @@ importers: ../../packages/shared: dependencies: '@hcengineering/communication-sdk-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../sdk-types '@hcengineering/communication-types': - specifier: workspace:^0.7.1 + specifier: workspace:^0.7.2 version: link:../types '@hcengineering/hulylake-client': specifier: ^0.7.1 diff --git a/common/scripts/package.json b/common/scripts/package.json index 96292077ed..64f5809044 100644 --- a/common/scripts/package.json +++ b/common/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/scripts", - "version": "0.7.1", + "version": "0.7.2", "scripts": { "format": "echo \"No format specified\"" }, diff --git a/packages/client-query/package.json b/packages/client-query/package.json index 2cd62e6773..47d9520725 100644 --- a/packages/client-query/package.json +++ b/packages/client-query/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-client-query", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -35,9 +35,9 @@ "typescript": "^5.8.3" }, "dependencies": { - "@hcengineering/communication-types": "workspace:^0.7.1", - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", - "@hcengineering/communication-query": "workspace:^0.7.1", + "@hcengineering/communication-types": "workspace:^0.7.2", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", + "@hcengineering/communication-query": "workspace:^0.7.2", "@hcengineering/hulylake-client": "^0.7.1", "fast-equals": "^5.2.2" }, diff --git a/packages/cockroach/package.json b/packages/cockroach/package.json index 5cab8d9aca..a0e7fd1873 100644 --- a/packages/cockroach/package.json +++ b/packages/cockroach/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-cockroach", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -36,9 +36,9 @@ "@types/uuid": "^8.3.1" }, "dependencies": { - "@hcengineering/communication-types": "workspace:^0.7.1", - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", - "@hcengineering/communication-shared": "workspace:^0.7.1", + "@hcengineering/communication-types": "workspace:^0.7.2", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", + "@hcengineering/communication-shared": "workspace:^0.7.2", "postgres": "^3.4.7", "uuid": "^8.3.2" }, diff --git a/packages/query/package.json b/packages/query/package.json index f66310907e..fbc0134623 100644 --- a/packages/query/package.json +++ b/packages/query/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-query", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -36,9 +36,9 @@ "@types/uuid": "^8.3.1" }, "dependencies": { - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", - "@hcengineering/communication-shared": "workspace:^0.7.1", - "@hcengineering/communication-types": "workspace:^0.7.1", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", + "@hcengineering/communication-shared": "workspace:^0.7.2", + "@hcengineering/communication-types": "workspace:^0.7.2", "@hcengineering/hulylake-client": "^0.7.1", "fast-equals": "^5.2.2", "uuid": "^8.3.2" diff --git a/packages/rest-client/package.json b/packages/rest-client/package.json index 147f2102dc..8cb624a50e 100644 --- a/packages/rest-client/package.json +++ b/packages/rest-client/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-rest-client", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -36,9 +36,9 @@ "@types/snappyjs": "^0.7.1" }, "dependencies": { - "@hcengineering/communication-types": "workspace:^0.7.1", - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", - "@hcengineering/communication-shared": "workspace:^0.7.1", + "@hcengineering/communication-types": "workspace:^0.7.2", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", + "@hcengineering/communication-shared": "workspace:^0.7.2", "@hcengineering/core": "^0.7.1", "snappyjs": "^0.7.0" }, diff --git a/packages/sdk-types/package.json b/packages/sdk-types/package.json index 413f43cc85..3acf65908c 100644 --- a/packages/sdk-types/package.json +++ b/packages/sdk-types/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-sdk-types", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -36,7 +36,7 @@ }, "dependencies": { "@hcengineering/core": "^0.7.1", - "@hcengineering/communication-types": "workspace:^0.7.1" + "@hcengineering/communication-types": "workspace:^0.7.2" }, "repository": { "type": "git", diff --git a/packages/server/package.json b/packages/server/package.json index 8990eb36ea..6ad12bafac 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-server", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -37,10 +37,10 @@ }, "dependencies": { "@hcengineering/account-client": "^0.7.1", - "@hcengineering/communication-cockroach": "workspace:^0.7.1", - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", - "@hcengineering/communication-shared": "workspace:^0.7.1", - "@hcengineering/communication-types": "workspace:^0.7.1", + "@hcengineering/communication-cockroach": "workspace:^0.7.2", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", + "@hcengineering/communication-shared": "workspace:^0.7.2", + "@hcengineering/communication-types": "workspace:^0.7.2", "@hcengineering/core": "^0.7.1", "@hcengineering/server-token": "^0.7.1", "@hcengineering/text-core": "^0.7.1", diff --git a/packages/server/src/blob.ts b/packages/server/src/blob.ts index 6e0438c73a..ffa072b1fb 100644 --- a/packages/server/src/blob.ts +++ b/packages/server/src/blob.ts @@ -543,9 +543,10 @@ export class Blob { private serializeMessage (message: Message): MessageDoc { return { ...message, + language: message.language ?? null, extra: message.extra ?? {}, created: message.created.toISOString(), - modified: message.modified?.toISOString(), + modified: message.modified?.toISOString() ?? null, reactions: {}, attachments: {}, threads: {} diff --git a/packages/shared/package.json b/packages/shared/package.json index b453a19ecd..8e19920426 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-shared", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", @@ -35,8 +35,8 @@ "typescript": "^5.8.3" }, "dependencies": { - "@hcengineering/communication-types": "workspace:^0.7.1", - "@hcengineering/communication-sdk-types": "workspace:^0.7.1", + "@hcengineering/communication-types": "workspace:^0.7.2", + "@hcengineering/communication-sdk-types": "workspace:^0.7.2", "@hcengineering/hulylake-client": "^0.7.1" }, "repository": { diff --git a/packages/shared/src/processor.ts b/packages/shared/src/processor.ts index 96b043f2a0..d32a28e2ae 100644 --- a/packages/shared/src/processor.ts +++ b/packages/shared/src/processor.ts @@ -141,9 +141,10 @@ function applyPatchEvent (message: Message, event: PatchEvent): Message | undefi if (date.getTime() < (message.modified?.getTime() ?? 0)) { return message } + const shouldUpdateDate = event.content != null || event.extra != null return { ...message, - modified: date, + modified: shouldUpdateDate ? date : message.modified, content: event.content ?? message.content, extra: event.extra ?? message.extra, language: event.language ?? message.language diff --git a/packages/types/package.json b/packages/types/package.json index 6e25216850..9a0114eeb4 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/communication-types", - "version": "0.7.1", + "version": "0.7.2", "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", diff --git a/packages/types/src/file.ts b/packages/types/src/file.ts index fb484ad956..1acbf257bd 100644 --- a/packages/types/src/file.ts +++ b/packages/types/src/file.ts @@ -32,8 +32,8 @@ export interface MessageDoc { type: MessageType content: Markdown extra: MessageExtra - language?: string | null - modified?: string | null // ISO date + language: string | null + modified: string | null // ISO date reactions: Record> attachments: Record