From 134b71e86ecaaa200a43ed0be842258b611d70d5 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Fri, 3 Oct 2025 12:26:56 +0700 Subject: [PATCH] fix: pass socialId when patching blobs Signed-off-by: Alexander Onnikov --- pods/media/src/client.ts | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pods/media/src/client.ts b/pods/media/src/client.ts index 268cca4c832..f606c2d0b32 100644 --- a/pods/media/src/client.ts +++ b/pods/media/src/client.ts @@ -44,9 +44,10 @@ import core, { import { type RestClient, createRestClient } from '@hcengineering/api-client' import { getTransactorEndpoint } from '@hcengineering/server-client' import { generateToken } from '@hcengineering/server-token' -import { MessageEventType } from '@hcengineering/communication-sdk-types' +import { AttachmentPatchEvent, MessageEventType } from '@hcengineering/communication-sdk-types' import { BlobSourceType, type VideoTranscodeResult } from './types' +import { AttachmentID } from '@hcengineering/communication-types' async function getClient (workspace: WorkspaceUuid, token: string): Promise { const endpoint = await getTransactorEndpoint(token) @@ -128,25 +129,26 @@ export class WorkspaceClient { return } + const event: AttachmentPatchEvent = { + type: MessageEventType.AttachmentPatch, + cardId: result.source.cardId, + messageId: result.source.messageId, + socialId: core.account.System, + operations: [ + { + opcode: 'update', + attachments: [ + { + id: result.blobId as AttachmentID, + params: { metadata } + } + ] + } + ] + } + const txOps = new TxOperations(this.client, core.account.System) - await txOps.domainRequest('communication' as OperationDomain, { - event: { - type: MessageEventType.AttachmentPatch, - cardId: result.source.cardId, - messageId: result.source.messageId, - operations: [ - { - opcode: 'update', - attachments: [ - { - id: result.blobId, - params: { metadata } - } - ] - } - ] - } - }) + await txOps.domainRequest('communication' as OperationDomain, { event }) } }