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]: shell commands execution failure on app reload #427

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

PuneetP16
Copy link

@PuneetP16 PuneetP16 commented Nov 26, 2024

Behavior

When the app reloads, it re-runs all the commands, but the shell commands were failing. To fix this issue, I've made the following change in the app/lib/runtime/action-runner.ts file:

Now the actions are properly awaited

Before Change:
image

After Change:
image

Key Change

Addition of the return statement before calling this.#executeAction. This ensures that the promise returned by this.#executeAction is properly awaited and propagated through the promise chain, preventing the subsequent actions from running before the current one has completed.

Testing

  • ✅ Manually verified that shell commands now execute successfully during app reload
  • ✅ Confirmed actions run in the correct sequence

Note: Code changes also contains a prettier fix regarding let currentLevel: DebugLevel = (import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV) ? 'debug' : 'info';

needed to return promise for proper artifact chaining
})
.catch((error) => {
console.error('Action failed:', error);
});
return this.#currentExecutionPromise;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Added this line for inter artifact chaining to work properly in workbench level

@thecodacus thecodacus merged commit fe45651 into stackblitz-labs:main Nov 29, 2024
1 of 2 checks passed
@thecodacus
Copy link
Collaborator

thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants