[fix]: shell commands execution failure on app reload #427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
After Change:
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
Note: Code changes also contains a prettier fix regarding
let currentLevel: DebugLevel = (import.meta.env.VITE_LOG_LEVEL ?? import.meta.env.DEV) ? 'debug' : 'info';