diff --git a/packages/presentation/src/collaborator.ts b/packages/presentation/src/collaborator.ts index 0da961198c..712a90d0b0 100644 --- a/packages/presentation/src/collaborator.ts +++ b/packages/presentation/src/collaborator.ts @@ -21,7 +21,7 @@ import presentation from './plugin' /** @public */ export function getCollaboratorClient (): CollaboratorClient { - const workspaceId = getWorkspaceId(getMetadata(presentation.metadata.Workspace) ?? '') + const workspaceId = getWorkspaceId(getMetadata(presentation.metadata.WorkspaceId) ?? '') const token = getMetadata(presentation.metadata.Token) ?? '' const collaboratorURL = getMetadata(presentation.metadata.CollaboratorUrl) ?? '' diff --git a/plugins/guest-resources/src/connect.ts b/plugins/guest-resources/src/connect.ts index 6945461802..ff15218d26 100644 --- a/plugins/guest-resources/src/connect.ts +++ b/plugins/guest-resources/src/connect.ts @@ -184,7 +184,7 @@ function clearMetadata (ws: string): void { delete tokens[loc.path[1]] setMetadataLocalStorage(login.metadata.LoginTokens, tokens) } - const currentWorkspace = getMetadata(presentation.metadata.Workspace) + const currentWorkspace = getMetadata(presentation.metadata.WorkspaceId) if (currentWorkspace !== undefined) { setPresentationCookie('', currentWorkspace) } diff --git a/plugins/text-editor-resources/src/provider/indexeddb.ts b/plugins/text-editor-resources/src/provider/indexeddb.ts index ce5e4858cd..9ce1f2a0d1 100644 --- a/plugins/text-editor-resources/src/provider/indexeddb.ts +++ b/plugins/text-editor-resources/src/provider/indexeddb.ts @@ -26,7 +26,7 @@ export class IndexeddbProvider extends IndexeddbPersistence implements Provider readonly awareness: Awareness | null = null constructor (documentId: string, doc: YDoc) { - const workspaceId: string = getMetadata(presentation.metadata.Workspace) ?? '' + const workspaceId: string = getMetadata(presentation.metadata.WorkspaceId) ?? '' const name = `${workspaceId}/${documentId}` diff --git a/plugins/text-editor-resources/src/provider/utils.ts b/plugins/text-editor-resources/src/provider/utils.ts index 803bed8980..693089ff04 100644 --- a/plugins/text-editor-resources/src/provider/utils.ts +++ b/plugins/text-editor-resources/src/provider/utils.ts @@ -31,7 +31,7 @@ import { IndexeddbProvider } from './indexeddb' import { type Provider } from './types' export function formatCollaborativeDocumentId (collaborativeDoc: CollaborativeDoc): DocumentId { - const workspace = getMetadata(presentation.metadata.Workspace) ?? '' + const workspace = getMetadata(presentation.metadata.WorkspaceId) ?? '' return formatDocumentId(workspace, collaborativeDoc) } diff --git a/plugins/workbench-resources/src/connect.ts b/plugins/workbench-resources/src/connect.ts index 60b895527b..88d38aae52 100644 --- a/plugins/workbench-resources/src/connect.ts +++ b/plugins/workbench-resources/src/connect.ts @@ -348,7 +348,7 @@ function clearMetadata (ws: string): void { delete tokens[loc.path[1]] setMetadataLocalStorage(login.metadata.LoginTokens, tokens) } - const currentWorkspace = getMetadata(presentation.metadata.Workspace) + const currentWorkspace = getMetadata(presentation.metadata.WorkspaceId) if (currentWorkspace !== undefined) { setPresentationCookie('', currentWorkspace) } diff --git a/server/collaborator/src/extensions/authentication.ts b/server/collaborator/src/extensions/authentication.ts index 36ce389ed3..2d7081133b 100644 --- a/server/collaborator/src/extensions/authentication.ts +++ b/server/collaborator/src/extensions/authentication.ts @@ -46,7 +46,7 @@ export class AuthenticationExtension implements Extension { const workspaceInfo = await getWorkspaceInfo(data.token) // verify workspace url in the document matches the token - if (workspaceInfo.workspace !== workspaceId) { + if (workspaceInfo.workspaceId !== workspaceId) { throw new Error('documentName must include workspace id') } diff --git a/server/datalake/src/client.ts b/server/datalake/src/client.ts index fa9b91b2e9..f160afa964 100644 --- a/server/datalake/src/client.ts +++ b/server/datalake/src/client.ts @@ -49,7 +49,7 @@ export class Client { constructor (private readonly endpoint: string) {} getObjectUrl (ctx: MeasureContext, workspace: WorkspaceId, objectName: string): string { - const path = `/blob/${workspace.name}/${objectName}` + const path = `/blob/${workspace.name}/${encodeURIComponent(objectName)}` return concatLink(this.endpoint, path) } @@ -91,7 +91,7 @@ export class Client { const form = new FormData() const options: FormData.AppendOptions = { - filename: objectName, + filename: encodeURIComponent(objectName), contentType: metadata.type, knownLength: metadata.size, header: {