middleware icon indicating copy to clipboard operation
middleware copied to clipboard

CLI does not close when pressing X to exit the dev CLI

Open jayantbh opened this issue 1 year ago • 6 comments

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) image

Steps to reproduce:

  1. Ensure dev server is running via ./dev.sh
  2. Wait for everything to start fully.
  3. 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.

jayantbh avatar Oct 01 '24 19:10 jayantbh

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

thesujai avatar Oct 01 '24 20:10 thesujai

Hey @thesujai are you still working on this issue ?

rahullli avatar Oct 02 '24 15:10 rahullli

No I am not.

thesujai avatar Oct 02 '24 15:10 thesujai

Hey can i work on this issue? please assign me

shamun-khatri avatar Oct 04 '24 16:10 shamun-khatri

Sure, @shamun-khatri. Feel free to give it a shot.

jayantbh avatar Oct 04 '24 17:10 jayantbh

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. :)

jayantbh avatar Oct 10 '24 08:10 jayantbh

Should i give it a shot ?

aadarsh-nagrath avatar Oct 14 '24 14:10 aadarsh-nagrath

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.

shamun-khatri avatar Oct 15 '24 07:10 shamun-khatri

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.

jayantbh avatar Oct 15 '24 08:10 jayantbh

I'm un-assigning this issue so anyone coming to this later may attempt a fix till we have one.

jayantbh avatar Oct 15 '24 08:10 jayantbh

@jayantbh I have raised a pull request. please have a look at that.

shamun-khatri avatar Oct 15 '24 10:10 shamun-khatri

Let's hope that one line change was actually sufficient, or we'll have to reopen this.

jayantbh avatar Oct 22 '24 16:10 jayantbh

I hope too, currently, that is working but in the future, if any problem persists. Will look on more depth into this.

shamun-khatri avatar Oct 22 '24 17:10 shamun-khatri