middleware
middleware copied to clipboard
CLI does not close when pressing X to exit the dev CLI
Description:
When you're in the dev CLI, you're prompted to press X to close the dev server. That does kill the containers, but it doesn't fully detach from the process.
Image (credit: @thesujai)
Steps to reproduce:
- Ensure dev server is running via ./dev.sh
- Wait for everything to start fully.
- Once ready, press
x.
Expected behavior:
All containers are killed ✅ Process detaches cleanly from the terminal ❌
Actual behavior:
As shared in the screenshot above, process does not detach cleanly from the terminal.
Whoever is picking this, the bug is because:
The useEffect(Which is suppose to close the process) is never triggered because the appState is not updating here. I checked with log statements, the appState before and after this dispatch() is same. So our exit() in the useEffect is never called
Hey @thesujai are you still working on this issue ?
No I am not.
Hey can i work on this issue? please assign me
Sure, @shamun-khatri. Feel free to give it a shot.
Hey @shamun-khatri, how's it going? Are you still working on this? I'd be okay with reassigning this in case you're occupied with other things. :)
Should i give it a shot ?
Whoever is picking this, the bug is because:
The useEffect(Which is suppose to close the process) is never triggered because the appState is not updating here. I checked with log statements, the appState before and after this dispatch() is same. So our exit() in the useEffect is never called
@jayantbh Sorry for the delay I was not feeling well for a couple of days and also I got stuck on another work.
The comment by @thesujai that I am replying to is not the problem. I have tried debugging and find that Appstate is changing well. and it becomes terminated and also that useEffect hook is calling which leads to exit().
But then also it is not detached to the terminal.
I am looking for the solution but this comment might be useful if someone is looking at the wrong place.
Thanks for looking into that, @shamun-khatri. :) Feel free to continue looking into this.
Same goes for @aadarsh-nagrath or anyone coming to this later.
I'm un-assigning this issue so anyone coming to this later may attempt a fix till we have one.
@jayantbh I have raised a pull request. please have a look at that.
Let's hope that one line change was actually sufficient, or we'll have to reopen this.
I hope too, currently, that is working but in the future, if any problem persists. Will look on more depth into this.