Skip to content
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(editor): Fix execution running status listener for chat messages #12951

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

alexgrozav
Copy link
Member

Summary

Before

Screen.Recording.2025-01-30.at.15.02.01.mov

After

Screen.Recording.2025-01-30.at.15.04.16.mov

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-601/execution-never-appears-to-start-on-the-fe

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@alexgrozav alexgrozav self-assigned this Jan 30, 2025
@@ -263,14 +264,18 @@ describe('CanvasChat', () => {
// Send message
const input = await findByTestId('chat-input');
await userEvent.type(input, 'Test message');

workflowsStore.isWorkflowRunning = true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since runWorkflow resolve is mocked, the isWorkflowRunning will be false from the first run. This means that the loading state never gets a chance to appear. We're forcing isWorkflowRunning to be true for the first run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Alex, for the next person looking at this test, would this be worth adding as a comment in the code?

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 30, 2025
// Stop the watcher when the promise is resolved
stopWatch();
return await new Promise<void>((resolve) => {
const resolveIfFinished = (isRunning: boolean) => {
Copy link
Member Author

@alexgrozav alexgrozav Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stopping watcher and resolving in separate function due to possible unwatch used before initialization error when using with immediate: true, if it runs on the first attempt. This could happen if for any reason runWorkflow (the prerequisite for this promise) fails.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@tomi tomi added the release/backport Changes that need to be backported to older releases. label Jan 30, 2025
Copy link

cypress bot commented Jan 30, 2025

n8n    Run #9049

Run Properties:  status check passed Passed #9049  •  git commit 3e311253d4: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 alexgrozav 🗃️ e2e/*
Project n8n
Branch Review cat-601-execution-never-appears-to-start-on-the-fe
Run status status check passed Passed #9049
Run duration 04m 22s
Commit git commit 3e311253d4: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 alexgrozav 🗃️ e2e/*
Committer Alex Grozav
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 5
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 432
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@tomi tomi merged commit 4d55a29 into master Jan 31, 2025
75 checks passed
@tomi tomi deleted the cat-601-execution-never-appears-to-start-on-the-fe branch January 31, 2025 07:49
@github-actions github-actions bot mentioned this pull request Feb 3, 2025
@github-actions github-actions bot mentioned this pull request Feb 3, 2025
@janober
Copy link
Member

janober commented Feb 3, 2025

Got released with [email protected]

This was referenced Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team release/backport Changes that need to be backported to older releases. Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants