-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
refactor(editor): Enable collaboration features only in NodeView v2 (no-changelog) #10756
Conversation
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.
LGTM 🚀
n8n Run #6833
Run Properties:
|
Project |
n8n
|
Branch Review |
remove-collaboration-from-v1-nodeview
|
Run status |
Passed #6833
|
Run duration | 04m 43s |
Commit |
eb87ad9ed1: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
|
Committer | कारतोफ्फेलस्क्रिप्ट™ |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
427
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
b249fa4
to
acdc168
Compare
acdc168
to
5b4ba90
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.
Code looks good. It's much cleaner this way.
But looks like the notifyWorkflowClosed
is not fired properly when tab is closed (or on reload):
Screen.Recording.2024-09-11.at.09.16.43.mov
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.
Works really nicely now, and it's better structured 👍 Couple comments / questions
const msgData: IActiveWorkflowUsersChanged = { | ||
const users = await this.userRepository.getByIds(this.userRepository.manager, userIds); | ||
const activeCollaborators = users.map((user) => ({ | ||
user: user.toIUser(), |
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.
What's the difference between IUser
and Public user
? Which one should be used going forward?
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.
IUser
is the just id
, email
, firstName
, and lastName
. We should be returning that to the frontend everywhere, unless any other field is explicitly needed.
PublicUser
was originally meant to be this, but has now instead become too loaded, and leaks too much data about other users.
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 we could mark it as @deprecated
@@ -17,42 +15,40 @@ import { useWorkflowsStore } from '@/stores/workflows.store'; | |||
export function useBeforeUnload({ route }: { route: ReturnType<typeof useRoute> }) { |
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.
It would actually make more sense to rename this into useCanvasBeforeUnload
since this contains business logic and split out a generic useBeforeUnload
into a separate composable. No need to do here, I can also do it as a follow up.
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.
this is mostly generic now, and can be used by other views as well.
We do have uiStore.stateIsDirty
that's currently only used in canvas. but we could reuse that to mark when any view has unsaved changes.
|
||
const heartbeatTimer = ref<number | null>(null); | ||
|
||
const startHeartbeat = () => { |
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.
Good idea to bring this into this store 👍
return; | ||
notifyWorkflowClosed(); | ||
stopHeartbeat(); | ||
pushStore.clearQueue(); |
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.
I'm not sure if clearing the queue should be collaborationStores responsibility, as the queue should be private implementation detail of pushStore. Sure it works now, as this is the only one sending messages, but in a general case there could be items from other producers.
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.
I think we need to move the queue in this store. but I'd like to do that refactor in another PR.
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.
Thank you for fixing this ❤️ 🚀
✅ All Cypress E2E specs passed |
Got released with |
* master: refactor(core): Revamp subworkflow policy checker errors (#10752) ci(benchmark): Add missing license cert (#10773) feat(editor): Show Collaboration pane only when there are multiple active users (#10772) 🚀 Release 1.59.0 (#10775) feat: Add credential help to Assistant (no-changelog) (#10736) fix(editor): Fix error rendering and indexing of LLM sub-node outputs (#10688) feat(OpenAI Node): Add Max Tools Iteration parameter and prevent tool calling after execution is aborted (#10735) fix(editor): Revert remove tooltip from info tip (no-changelog) (#10771) refactor(editor): Enable collaboration features only in NodeView v2 (no-changelog) (#10756) fix(If Node): Update copy for type conversion parameter (#10769) build(core): Allow adding tests side by side with the code (#10760) # Conflicts: # packages/editor-ui/src/stores/assistant.store.ts
Summary
collaboration features aren't working on NodeView v1 as expected. Instead of trying to fix it, in this PR, we disable these features altogether for v1.
Review / Merge checklist