-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Extension
Collaborative Editing
Describe the Bug
If you disable collaborative editing globally, it doesn't work at all, even after manually adding the necessary interface.
Scenario
- Collaborative editing module enabled
- Enable Globally setting for collaborative editing is disabled
- Collaboration interface added for a collection manually
Symptoms
- Opening two editors doesn't show any collaboration avatar or synced changes on a given field
- There's no connection to
/websocket
when viewing Network tools in the browser
Potential issue
I'm still pretty new to Directus, but it seems like we'd expect the Interface to connect to realtime (/websocket). In this code, it seems like it only connects if enabled globally:
extensions/packages/collaborative-editing/src/interface/interface.vue
Lines 59 to 65 in 021b6d0
const realtimeEnabled = computed(() => { | |
const moduleEnabled = (settingsStore.settings as Settings)?.module_bar.find( | |
(module) => module.type === 'module' && module.id === MODULE_ID, | |
)?.enabled; | |
const enabledGlobally = settings.value?.enabled_globally; | |
return moduleEnabled && enabledGlobally; |
If you follow that usage, provider.connect()
is skipped, and that seems like it's what eventually would have connected to the websocket.
Not sure if there are any other issues, but we at least know for sure if there's no connection, it can't work.
To Reproduce
Confirm it works globally
- Install
@directus-labs/[email protected]
- Enable the module
- Go to /admin/collaborative-editing and confirm it's enabled globally
- Go to an edit page, and confirm there's a request to
/websocket
Disable globally, and enable selectively
- Go to /admin/collaborative-editing, uncheck
Enabled
, Save - Go to /admin/settings/data-model, click on any model,
Create Field
, chooseCollaboration
, Save - Go to an edit page for that model and there will be no
/websocket
request
Directus Version
11.12.0
Hosting Strategy
Self-Hosted (Docker Image)
Metadata
Metadata
Assignees
Labels
No labels