diff --git a/apps/web/core/components/pages/editor/editor-body.tsx b/apps/web/core/components/pages/editor/editor-body.tsx index a57f44058..64c907275 100644 --- a/apps/web/core/components/pages/editor/editor-body.tsx +++ b/apps/web/core/components/pages/editor/editor-body.tsx @@ -152,10 +152,17 @@ export const PageEditorBody: React.FC = observer((props) => { const isSecureEnvironment = window.location.protocol === "https:"; WS_LIVE_URL.protocol = isSecureEnvironment ? "wss" : "ws"; WS_LIVE_URL.pathname = `${LIVE_BASE_PATH}/collaboration`; + + // Append query parameters to the URL + Object.entries(webhookConnectionParams) + .filter(([_, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + WS_LIVE_URL.searchParams.set(key, String(value)); + }); + // Construct realtime config return { url: WS_LIVE_URL.toString(), - queryParams: webhookConnectionParams, }; } catch (error) { console.error("Error creating realtime config", error); diff --git a/packages/editor/package.json b/packages/editor/package.json index 9ff1b62d4..2bf6fbe52 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -38,7 +38,7 @@ "@floating-ui/dom": "^1.7.1", "@floating-ui/react": "^0.26.4", "@headlessui/react": "^1.7.3", - "@hocuspocus/provider": "^2.15.0", + "@hocuspocus/provider": "3.2.5", "@plane/constants": "workspace:*", "@plane/hooks": "workspace:*", "@plane/types": "workspace:*", diff --git a/packages/editor/src/core/hooks/use-collaborative-editor.ts b/packages/editor/src/core/hooks/use-collaborative-editor.ts index 514ee4019..54135f785 100644 --- a/packages/editor/src/core/hooks/use-collaborative-editor.ts +++ b/packages/editor/src/core/hooks/use-collaborative-editor.ts @@ -45,7 +45,6 @@ export const useCollaborativeEditor = (props: TCollaborativeEditorHookProps) => () => new HocuspocusProvider({ name: id, - parameters: realtimeConfig.queryParams, // using user id as a token to verify the user on the server token: JSON.stringify(user), url: realtimeConfig.url, diff --git a/packages/editor/src/core/types/config.ts b/packages/editor/src/core/types/config.ts index dda8b45a3..67b4b310f 100644 --- a/packages/editor/src/core/types/config.ts +++ b/packages/editor/src/core/types/config.ts @@ -42,7 +42,6 @@ export type TUserDetails = { export type TRealtimeConfig = { url: string; - queryParams: TWebhookConnectionQueryParams; }; export type IMarking = { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b638c01c..3176fb325 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -715,8 +715,8 @@ importers: specifier: ^1.7.3 version: 1.7.19(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@hocuspocus/provider': - specifier: ^2.15.0 - version: 2.15.3(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27) + specifier: 3.2.5 + version: 3.2.5(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27) '@plane/constants': specifier: workspace:* version: link:../constants @@ -1912,9 +1912,6 @@ packages: react: ^16 || ^17 || ^18 react-dom: ^16 || ^17 || ^18 - '@hocuspocus/common@2.15.3': - resolution: {integrity: sha512-Rzh1HF0a2o/tf90A3w2XNdXd9Ym3aQzMDfD3lAUONCX9B9QOdqdyiORrj6M25QEaJrEIbXFy8LtAFcL0wRdWzA==} - '@hocuspocus/common@3.2.5': resolution: {integrity: sha512-unodX1+dBUp2sink7nKg/PSNDDUjM+AyMxg3WGpRTZb1LI0z/22DjjwFCgWWvoCNQALPVp9PFB/wyAI0xNo6GA==} @@ -1932,8 +1929,8 @@ packages: y-protocols: ^1.0.6 yjs: ^13.6.8 - '@hocuspocus/provider@2.15.3': - resolution: {integrity: sha512-oadN05m+KL4ylNKVo5YspNG4MXkT2Y+FUFzrgigpQeTjQibkPUwCNmUnkUxMgrGRgxb+O0lJCfirFIJMxedctA==} + '@hocuspocus/provider@3.2.5': + resolution: {integrity: sha512-UZpmPYSp8T2ms1E049GayQcaUIVBAZCWiNIiuxfO/+lydTto8svqEgJVmIUqxmSJ3lO64zo9wsyQz9wXu2hlnQ==} peerDependencies: y-protocols: ^1.0.6 yjs: ^13.6.8 @@ -9003,10 +9000,6 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@hocuspocus/common@2.15.3': - dependencies: - lib0: 0.2.114 - '@hocuspocus/common@3.2.5': dependencies: lib0: 0.2.114 @@ -9043,9 +9036,9 @@ snapshots: - supports-color - utf-8-validate - '@hocuspocus/provider@2.15.3(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)': + '@hocuspocus/provider@3.2.5(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)': dependencies: - '@hocuspocus/common': 2.15.3 + '@hocuspocus/common': 3.2.5 '@lifeomic/attempt': 3.1.0 lib0: 0.2.114 ws: 8.18.3