-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
fix(API): Fix workflow project transfer #10651
Conversation
This commit updates the unit test to reproduce an issue that was detected. A separate commit will be used to fix the problem. The output below is from this test failure: n8n:test: ● PUT /workflows/:id/transfer › should transfer workflow to project n8n:test: n8n:test: expect(received).toBe(expected) // Object.is equality n8n:test: n8n:test: Expected: "htfVcAUznnWmLzQE" n8n:test: Received: "gLQLBvrhUglvs1DC" n8n:test: n8n:test: 1537 | const workflowsInProjectResponse = await authMemberAgent.get(`/workflows?projectId=${secondProject.id}`).send(); n8n:test: 1538 | expect(workflowsInProjectResponse.statusCode).toBe(200); n8n:test: > 1539 | expect(workflowsInProjectResponse.body.data[0].id).toBe(workflow.id); n8n:test: | ^ n8n:test: 1540 | }); n8n:test: 1541 | n8n:test: 1542 | test('if no destination project, should reject', async () => { n8n:test: n8n:test: at Object.<anonymous> (test/integration/publicApi/workflows.test.ts:1539:54) n8n:test:
…er workflow to project via public api Transfering a workflow to another project using the public API was failing because the code was dereferencing that wrong parameter name and getting undefined.
Hey @benrobot, Thanks for the PR, We have created "GHC-199" as the internal reference to get this reviewed. One of us will be in touch if there are any changes needed, in most cases this is normally within a couple of weeks but it depends on the current workload of the team. |
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 catch! Thank you for your contribution.
@benrobot Thanks again for your contribution. Once the lint issues are fixed we can bring this in. Let us know if we can help or if you'd like for us to take over. |
* master: feat(Iterable Node): Add support for EDC and USDC selection (#10908) test(Schedule Trigger Node): Add tests and extract trigger test helper (no-changelog) (#10625) fix(Todoist Node): Fix listSearch filter bug in Todoist Node (#10989) fix(AwsS3 Node): Fix search only using first input parameters (#10998) fix(editor): Fix bug causing node issues to not be assigned before first interaction (no-changelog) (#10980) fix(editor): Allow resources to move between personal and team projects (#10683) fix(Respond to Webhook Node): Node does not work with Wait node (#10992) fix(core): Upgrade @n8n/typeorm to address a rare mutex release issue (#10993) refactor(core): Separate execution `startedAt` from `createdAt` (#10810) refactor(core): Make all pubsub messages type-safe (#10990) feat(Question and Answer Chain Node): Customize question and answer system prompt (#10385) fix(editor): Fix performance issue in credentials list (#10988) fix(RSS Feed Trigger Node): Fix regression on missing timestamps (#10991) fix(editor): Fix workflow executions list page redirection (#10981) fix(editor): Fix filter execution by "Queued" (#10987) fix(API): Fix workflow project transfer (#10651)
Got released with |
Summary
Transferring a workflow to a new project via the Public API was failing.
The unit test responsible for detecting this type of issue was only passing because there were no other workflows and projects in the database. After updating the test to match a more real-world scenario the test started to fail as shown in the screenshot below:
Related Linear tickets, Github issues, and Community forum posts
none
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)