Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WIKI-722] fix: hocuspocus provider update to v3 (#7930)

M. Palanikannan98e00897232f
diff --git a/apps/web/core/components/pages/editor/editor-body.tsx b/apps/web/core/components/pages/editor/editor-body.tsx
index a57f44058d..64c9072756 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<Props> = 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 9ff1b62d43..2bf6fbe52b 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 514ee4019c..54135f785d 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 dda8b45a36..67b4b310ff 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 2b638c01ce..3176fb3254 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -715,8 +715,8 @@ importers:
specifier: ^1.7.3
'@hocuspocus/provider':
- specifier: ^2.15.0
+ specifier: 3.2.5
'@plane/constants':
specifier: workspace:*
version: link:../constants
@@ -1912,9 +1912,6 @@ packages:
react: ^16 || ^17 || ^18
react-dom: ^16 || ^17 || ^18
- '@hocuspocus/[email protected]':
- resolution: {integrity: sha512-Rzh1HF0a2o/tf90A3w2XNdXd9Ym3aQzMDfD3lAUONCX9B9QOdqdyiORrj6M25QEaJrEIbXFy8LtAFcL0wRdWzA==}
-
'@hocuspocus/[email protected]':
resolution: {integrity: sha512-unodX1+dBUp2sink7nKg/PSNDDUjM+AyMxg3WGpRTZb1LI0z/22DjjwFCgWWvoCNQALPVp9PFB/wyAI0xNo6GA==}
@@ -1932,8 +1929,8 @@ packages:
y-protocols: ^1.0.6
yjs: ^13.6.8
- '@hocuspocus/[email protected]':
- resolution: {integrity: sha512-oadN05m+KL4ylNKVo5YspNG4MXkT2Y+FUFzrgigpQeTjQibkPUwCNmUnkUxMgrGRgxb+O0lJCfirFIJMxedctA==}
+ '@hocuspocus/[email protected]':
+ 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([email protected])
- '@hocuspocus/[email protected]':
- dependencies:
- lib0: 0.2.114
-
'@hocuspocus/[email protected]':
dependencies:
lib0: 0.2.114
@@ -9043,9 +9036,9 @@ snapshots:
- supports-color
- utf-8-validate
dependencies:
- '@hocuspocus/common': 2.15.3
+ '@hocuspocus/common': 3.2.5
'@lifeomic/attempt': 3.1.0
lib0: 0.2.114
ws: 8.18.3