-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Reintroduce collaboration feature #10602
feat: Reintroduce collaboration feature #10602
Conversation
try { | ||
await this.handleUserMessage(event.userId, event.msg); | ||
} catch (error) { | ||
this.logger.error('Error handling user message', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we report these to sentry? What's the correct way to do that? Throw an ApplicationError
and let the top-level handler take care of it?
const workflow = await this.sharedWorkflowRepository.findWorkflowForUser(workflowId, user, [ | ||
'workflow:read', | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally would want to check the permissions without needing to query the entire workflow. Might do that as a follow up
|
||
this.onMessageReceived(pushRef, JSON.parse(buffer.toString('utf8'))); | ||
} catch (error) { | ||
this.logger.error("Couldn't parse message from editor-UI", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should also report this to sentry?
@@ -0,0 +1,82 @@ | |||
<script setup lang="ts"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1:1 copy from the one we had before
@@ -252,6 +254,8 @@ async function initializeData() { | |||
|
|||
try { | |||
await Promise.all(loadPromises); | |||
|
|||
collaborationStore.notifyWorkflowOpened(workflowId.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct place where this should be sent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better place would be the initializeWorkspaceForExistingWorkflow
or openWorkflow
method in the same file.
0a316a0
to
4427285
Compare
Collaboration feature was removed because it was missing authorization checks. This adds checks that user can't send workflow opened or closed message, unless they have access to that workflow. Also uses `cache` for storing the collaboration state, so the feature works correctly with multiple mains. The feature is currently only enabled for the new canvas, as that should come live soon anyways.
4427285
to
ceb0ab7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disclaimer: I did not review the FE code.
The backend good looks good, also the permission related code. 🚀
I only made some smaller suggestions to the tests.
packages/cli/test/integration/collaboration/collaboration.service.test.ts
Outdated
Show resolved
Hide resolved
Thank you for a great review @despairblue ! I addressed all your comments. LMK if I missed something ✌️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🚀
Approving the backend changes!
n8n Run #6724
Run Properties:
|
Project |
n8n
|
Branch Review |
cat-79-bug-collaborationservice-does-not-implement-access-control
|
Run status |
Passed #6724
|
Run duration | 04m 45s |
Commit |
9d974342b2: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 tomi 🗃️ e2e/*
|
Committer | Tomi Turtiainen |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
421
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the minor comments I left, front-end part looks good to me.
However, I am seeing some unexpected behavior when switching users (the list is not always synced in both user sessions):
Screen.Recording.2024-08-30.at.18.00.39.mov
@@ -252,6 +254,8 @@ async function initializeData() { | |||
|
|||
try { | |||
await Promise.all(loadPromises); | |||
|
|||
collaborationStore.notifyWorkflowOpened(workflowId.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better place would be the initializeWorkspaceForExistingWorkflow
or openWorkflow
method in the same file.
Couldn't reproduce anymore after changing the place where we notify workflow opened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing!
Looking good with the latest changes 🙌
✅ All Cypress E2E specs passed |
* master: refactor(RabbitMQ Trigger Node): Improve type-safety, add tests, and fix issues with manual triggers (#10663) feat(editor): Add support for nodes with multiple main inputs in new canvas (no-changelog) (#10659) fix(editor): Set minimum zoom to 0 to allow fitting very large workflows in new canvas (no-changelog) (#10666) feat(editor): Change selection to be default canvas behaviour (no-changelog) (#10668) feat: More hints to nodes (#10565) fix(editor): Fix opening executions tab from a new, unsaved workflow (#10652) fix(AI Agent Node): Fix tools agent when using memory and Anthropic models (#10513) feat(editor): Make highlighted data pane floating (#10638) fix(editor): Fix workflow loading after switching to executions view in new canvas (no-changelog) (#10655) refactor(benchmark): Separate cloud env provisioning from running benchmarks (#10657) feat(core): Implement wrapping of regular nodes as AI Tools (#10641) refactor(editor): Remove Trial logic in personalization modal and port to script setup (#10649) fix(core): Declutter webhook insertion errors (#10650) feat: Reintroduce collaboration feature (#10602) feat(benchmark): Add scenario for expressions with Set node (#10647) feat(benchmark): Add benchmark scenario for binary files (#10648) build: Add `reset` script (#10627) feat(editor): Overhaul node insert position computation in new canvas (no-changelog) (#10637)
Got released with |
Summary
Collaboration feature was removed because it was missing authorization checks. This adds checks that user can't send workflow opened or closed message, unless they have access to that workflow. Also uses
cache
for storing the collaboration state, so the feature works correctly with multiple mains.The feature is currently only enabled for the new canvas, as that should come live soon anyways.
Related Linear tickets, Github issues, and Community forum posts
CAT-79
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)