From b5da594b5e89dfbb468c3af1fb734d82e61dfdd4 Mon Sep 17 00:00:00 2001 From: Kristina Date: Fri, 16 May 2025 11:17:10 +0400 Subject: [PATCH 1/7] Fix communication api config (#8955) Signed-off-by: Kristina Fefelova --- desktop/src/ui/platform.ts | 2 +- desktop/src/ui/types.ts | 2 +- dev/prod/public/config.json | 2 +- dev/prod/src/platform.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/src/ui/platform.ts b/desktop/src/ui/platform.ts index 489aee08fd..cf307c2060 100644 --- a/desktop/src/ui/platform.ts +++ b/desktop/src/ui/platform.ts @@ -270,7 +270,7 @@ export async function configurePlatform (): Promise { setMetadata(github.metadata.GithubClientID, config.GITHUB_CLIENTID ?? '') setMetadata(github.metadata.GithubURL, config.GITHUB_URL ?? '') - setMetadata(communication.metadata.Enabled, config.COMMUNICATION_API_ENABLED) + setMetadata(communication.metadata.Enabled, config.COMMUNICATION_API_ENABLED === 'true') if (config.MODEL_VERSION != null) { console.log('Minimal Model version requirement', config.MODEL_VERSION) diff --git a/desktop/src/ui/types.ts b/desktop/src/ui/types.ts index dd8bca81c3..04ca2bf2ae 100644 --- a/desktop/src/ui/types.ts +++ b/desktop/src/ui/types.ts @@ -44,7 +44,7 @@ export interface Config { CALDAV_SERVER_URL?: string EXPORT_URL?: string MAIL_URL?: string - COMMUNICATION_API_ENABLED?: boolean + COMMUNICATION_API_ENABLED?: string } export interface Branding { diff --git a/dev/prod/public/config.json b/dev/prod/public/config.json index 590687fcaa..9f72ba38d4 100644 --- a/dev/prod/public/config.json +++ b/dev/prod/public/config.json @@ -25,5 +25,5 @@ "PUBLIC_SCHEDULE_URL": "http://huly.local:8060", "CALDAV_SERVER_URL": "http://huly.local:9070", "EXPORT_URL": "http://huly.local:4009", - "COMMUNICATION_API_ENABLED": true + "COMMUNICATION_API_ENABLED": "true" } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index f7a7aa27aa..945bfba6cf 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -193,7 +193,7 @@ export interface Config { CALDAV_SERVER_URL?: string EXPORT_URL?: string MAIL_URL?: string, - COMMUNICATION_API_ENABLED?: boolean + COMMUNICATION_API_ENABLED?: string } export interface Branding { @@ -442,7 +442,7 @@ export async function configurePlatform() { setMetadata(presentation.metadata.MailUrl, config.MAIL_URL) setMetadata(recorder.metadata.StreamUrl, config.STREAM_URL) setMetadata(textEditor.metadata.Collaborator, config.COLLABORATOR) - setMetadata(communication.metadata.Enabled, config.COMMUNICATION_API_ENABLED) + setMetadata(communication.metadata.Enabled, config.COMMUNICATION_API_ENABLED === 'true') if (config.MODEL_VERSION != null) { console.log('Minimal Model version requirement', config.MODEL_VERSION) From 4aef00c462e4ea4569fc35f9a2856ab6703e76c2 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Fri, 16 May 2025 14:59:07 +0700 Subject: [PATCH 2/7] fix: remove datalake extra retries on 404 (#8962) Signed-off-by: Alexander Onnikov --- server/datalake/src/client.ts | 14 ++++++++------ server/datalake/src/index.ts | 20 +++++++++++++++++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/server/datalake/src/client.ts b/server/datalake/src/client.ts index e9d5a6005c..ea8374a8ac 100644 --- a/server/datalake/src/client.ts +++ b/server/datalake/src/client.ts @@ -111,16 +111,17 @@ export class DatalakeClient { return (await response.json()) as ListObjectOutput } - async getObject (ctx: MeasureContext, workspace: WorkspaceUuid, objectName: string): Promise { + async getObject (ctx: MeasureContext, workspace: WorkspaceUuid, objectName: string): Promise { const url = this.getObjectUrl(ctx, workspace, objectName) let response try { response = await fetchSafe(ctx, url, { headers: { ...this.headers } }) } catch (err: any) { - if (err.name !== 'NotFoundError') { - console.error('failed to get object', { workspace, objectName, err }) + if (err.name === 'NotFoundError') { + return undefined } + console.error('failed to get object', { workspace, objectName, err }) throw err } @@ -138,7 +139,7 @@ export class DatalakeClient { objectName: string, offset: number, length?: number - ): Promise { + ): Promise { const url = this.getObjectUrl(ctx, workspace, objectName) const headers = { ...this.headers, @@ -149,9 +150,10 @@ export class DatalakeClient { try { response = await fetchSafe(ctx, url, { headers }) } catch (err: any) { - if (err.name !== 'NotFoundError') { - console.error('failed to get partial object', { workspace, objectName, err }) + if (err.name === 'NotFoundError') { + return undefined } + console.error('failed to get partial object', { workspace, objectName, err }) throw err } diff --git a/server/datalake/src/index.ts b/server/datalake/src/index.ts index 94a58c0230..bc5b440be9 100644 --- a/server/datalake/src/index.ts +++ b/server/datalake/src/index.ts @@ -33,6 +33,7 @@ import { import { generateToken } from '@hcengineering/server-token' import { type Readable } from 'stream' import { type UploadObjectParams, DatalakeClient } from './client' +import { NotFoundError } from './error' export { DatalakeClient } @@ -168,7 +169,11 @@ export class DatalakeService implements StorageAdapter { @withContext('get') async get (ctx: MeasureContext, wsIds: WorkspaceIds, objectName: string): Promise { - return await this.retry(ctx, () => this.client.getObject(ctx, wsIds.uuid, objectName)) + const object = await this.retry(ctx, () => this.client.getObject(ctx, wsIds.uuid, objectName)) + if (object === undefined) { + throw new NotFoundError() + } + return object } @withContext('put') @@ -199,8 +204,11 @@ export class DatalakeService implements StorageAdapter { @withContext('read') async read (ctx: MeasureContext, wsIds: WorkspaceIds, objectName: string): Promise { const data = await this.retry(ctx, () => this.client.getObject(ctx, wsIds.uuid, objectName)) - const chunks: Buffer[] = [] + if (data === undefined) { + throw new NotFoundError() + } + const chunks: Buffer[] = [] for await (const chunk of data) { chunks.push(chunk) } @@ -216,7 +224,13 @@ export class DatalakeService implements StorageAdapter { offset: number, length?: number ): Promise { - return await this.retry(ctx, () => this.client.getPartialObject(ctx, wsIds.uuid, objectName, offset, length)) + const object = await this.retry(ctx, () => + this.client.getPartialObject(ctx, wsIds.uuid, objectName, offset, length) + ) + if (object === undefined) { + throw new NotFoundError() + } + return object } async getUrl (ctx: MeasureContext, wsIds: WorkspaceIds, objectName: string): Promise { From d0dc3076e02dd6da8f1e28feeeaac9ea86623b15 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Fri, 16 May 2025 13:30:16 +0400 Subject: [PATCH 3/7] Bump model version (#8963) --- common/scripts/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/scripts/version.txt b/common/scripts/version.txt index a34392fadc..9ccacbd7cd 100644 --- a/common/scripts/version.txt +++ b/common/scripts/version.txt @@ -1 +1 @@ -"0.7.75" +"0.7.110" From 04b01acad03432921248c89dfbdab802ad5b3a09 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 16 May 2025 16:30:43 +0700 Subject: [PATCH 4/7] Hidden RoomLanguageSelector (#8952) --- models/love/src/index.ts | 4 +++- plugins/love-resources/src/components/ControlBar.svelte | 4 ++-- plugins/love-resources/src/components/RoomPreview.svelte | 4 ++-- .../src/components/RoomTranscriptionSettings.svelte | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/models/love/src/index.ts b/models/love/src/index.ts index b04cc27484..22ef7df637 100644 --- a/models/love/src/index.ts +++ b/models/love/src/index.ts @@ -60,7 +60,8 @@ import { TypeRef, TypeString, UX, - TypeBoolean + TypeBoolean, + Hidden } from '@hcengineering/model' import calendar, { TEvent, TSchedule } from '@hcengineering/model-calendar' import core, { TAttachedDoc, TDoc } from '@hcengineering/model-core' @@ -110,6 +111,7 @@ export class TRoom extends TDoc implements Room { y!: number @Prop(TypeString(), love.string.Language, { editor: love.component.RoomLanguageEditor }) + @Hidden() language!: RoomLanguage @Prop(TypeBoolean(), love.string.StartWithTranscription) diff --git a/plugins/love-resources/src/components/ControlBar.svelte b/plugins/love-resources/src/components/ControlBar.svelte index b3f85026f7..587da92c8e 100644 --- a/plugins/love-resources/src/components/ControlBar.svelte +++ b/plugins/love-resources/src/components/ControlBar.svelte @@ -184,11 +184,11 @@ - + {#if room._id !== love.ids.Reception}