Activity Watch does not end with session - Xubuntu

Hello, I am running AW on two separate users in Xubuntu 18.04 LTS. It is set as an autostart application for each of the two users. When User 1 starts a session everything goes smoothly, but when User 2 starts a session after User 1 has closed his, a notification with the following text appears:

Module aw-server quit unexpectedly
2019-11-03 17:34:59 [INFO ]: Using storage method: peewee (aw_server.main:26)
2019-11-03 17:34:59 [INFO ]: Starting up… (aw_server.main:31)
2019-11-03 17:34:59 [INFO ]: Using database file: /home/user2/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db (aw_datastore.storages.peewee:90)
2019-11-03 17:34:59 [ERROR]: [Errno 98] Address already in use (aw_server.server:93)

Furthermore, if User 2 closes his session and User 1 opens another one, three notifications appear, with the following texts:

Module aw-watcher-afk quit unexpectedly
2019-11-03 17:39:21 [ERROR]: Another instance is already running, quitting. (aw_client.singleinstance:38)

Module aw-watcher-window quit unexpectedly
2019-11-03 17:39:21 [ERROR]: Another instance is already running, quitting. (aw_client.singleinstance:38)

Module aw-server quit unexpectedly
2019-11-03 17:39:23 [INFO ]: Using storage method: peewee (aw_server.main:26)
2019-11-03 17:39:23 [INFO ]: Starting up… (aw_server.main:31)
2019-11-03 17:39:23 [INFO ]: Using database file: /home/user1/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db (aw_datastore.storages.peewee:90)
2019-11-03 17:39:23 [ERROR]: [Errno 98] Address already in use (aw_server.server:93)

It seems that AW does not terminate when a session is closed. For the moment, I have to shut down the computer on every user change, which is a nuisance. How can this be fixed?

Thanks and keep up the good work!

This is the only thing I can make out from the logs as well.

How are you auto-starting it? Are you doing a proper log-out or are you just switching user? Those are the only two possible issues from the top of my head which could break it like that.

Hello,

Autostarting is handled by the OS itself; one only has to include the application in question in a list of applications that are launched automatically when a session is started. From a user’s point of view, I assume that all applications are terminated when exiting the session (or they should). I have had no duplication issues with other autostart applications when closing a session and starting another one.

Users always do log out properly, so that only one user is logged in at a time.

Kind regards,

Created an issue on GitHub for aw-qt, when looking at the code there are obvious flaws regarding shutting down the subprocesses which needs to be fixed which we had forgotten. Thanks for reporting.