lencx / ChatGPT

🔮 ChatGPT Desktop Application (Mac, Windows and Linux)
https://nofwl.com
52.98k stars 5.96k forks source link

[Bug] ChatGPT process will keep running after closing it #204

Open D3vil0p3r opened 1 year ago

D3vil0p3r commented 1 year ago

Version

v0.8.1

Bug description

I'm using Arch Linux and I noted that, when I run ChatGPT client and then I close it, it is apparently closed.

If I run the process list, in reality it is still in execution, indeed if you open the ChatGPT client one time, then you close it, and then you open again the client, in the running process list you will see two chat-gpt processes. It can have negative impact on the performance of the computer because the user will open several chat-gpt processes without being aware, and they consume PC resources.

$ ps aux | grep chat-gpt

user    538718  0.2  2.9 107746020 237428 ?    Sl   17:55   0:00 chat-gpt
user    540330 12.1  3.0 90966728 244112 ?     Sl   18:00   0:00 chat-gpt
user    540487  0.0  0.0   6564  2544 pts/0    S+   18:00   0:00 grep --color=auto chat-gpt

An explicit proof can be observed if you have a tool showing systray icons (like AppIndicator for GNOME) where, despite it is all closed, you will see several ChatGPT systray icons (because they are running despite their window is closed): image

This issue can be solved by forcing the application/process to terminate when the user quit the ChatGPT window close button.

Another solution could be: when the application is already running in background, if the user attempts to open it for the second time, the first application window appears, instead of creating a second one.

OS

Arch Linux latest version

Environment

GNOME 43 with Wayland but the environment is not related to the issue.

lencx commented 1 year ago

To exit the application use the menu Quit ChatGPT, or the shortcut Ctrl + Q. Window closing simply hides the window.

D3vil0p3r commented 1 year ago

To exit the application use the menu Quit ChatGPT, or the shortcut Ctrl + Q. Window closing simply hides the window.

Yes, I noted. But I think that the average user could think that closing the window is enough to stop the process. It could be a good idea to terminate the process when the user presses the window close button.

lencx commented 1 year ago

I will not implement this way of closing at the moment because it does not meet the expectations of the program. It exists to meet the needs of high frequency use and to prevent users from accidentally touching it and causing it to close.

D3vil0p3r commented 1 year ago

I will not implement this way of closing at the moment because it does not meet the expectations of the program.

I don't agree with this view, mostly if I "dress" as the average user because the close button is born for terminating processes in the standard code development (for the "hiding" there is the "reduce to icon" button), but it's ok, you are the dev.

and to prevent users from accidentally touching it and causing it to close.

If a user accidentally closes the window, all the contents the user has on ChatGPT are stored on the server side (not on its client), because this application is web-wrapper-like. So, if you ask to AI a question, and then you close accidentally the window, and then you reopen your client or your browser and enter again in your session, you will get what you sent to the OpenAI server.

It exists to meet the needs of high frequency use

I just warn for the possible big resource consumption (and system performance degradation) for the average users. Btw the effort for implementing it is very minimal.

lencx commented 1 year ago

You are not a product designer and you do not represent the majority of users, please use data to prove your concerns are correct. I can't make an app that fits anyone's needs.

D3vil0p3r commented 1 year ago

You are not a product designer and you do not represent the majority of users, please use data to prove your concerns are correct. I can't make an app that fits anyone's needs.

I am not the product designer of this specific application, but I work in this field, so I'm bringing to you concerns that are more technical and not at high abstraction level and that the majority of the users can experience without understanding the cause.

I give my data (with the duplicated processes of chat-gpt) above. I can also provide a resource consumption track during a hourly workload when the users use it and check how many processes will be opened and what is the resource consumption.

The best approach should be to make an interview to the "majority" of the users by asking "In which manner do you close ChatGPT Desktop application?". We can do this in the "Discussion" section of this repository. Let me to create a poll.

lencx commented 1 year ago

You can create a poll in discussions https://github.com/lencx/ChatGPT/discussions/categories/polls

D3vil0p3r commented 1 year ago

You can create a poll in discussions https://github.com/lencx/ChatGPT/discussions/categories/polls

Yes. Thank you. Here the poll: https://github.com/lencx/ChatGPT/discussions/205 Let's hope to have a good number of participants ^^

D3vil0p3r commented 1 year ago

I'm getting also in mind a lighter solution instead of the proposal above. If the user is running ChatGPT and close the window (and the process is still running), when he/she clicks again on ChatGPT icon, now it opens a second ChatGPT window, so you have two processes. Instead, the right solution is: when you open the second time ChatGPT app, it should reopen only the running one, and not a second one.