Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Siggo TUI empty on startup #27

Closed
beune opened this issue Nov 22, 2020 · 16 comments
Closed

Siggo TUI empty on startup #27

beune opened this issue Nov 22, 2020 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@beune
Copy link

beune commented Nov 22, 2020

Problem: when I start siggo, I get an empty TUI.

Here is the log file:

time="2020-11-22T20:11:22+01:00" level=warning msg="failed to read contacts from disk: json: cannot unmarshal string into Go struct field SignalGroup.groupStore.groups.members of type signal.SignalGroupMember"
time="2020-11-22T20:11:22+01:00" level=debug msg="contacts found: []"
time="2020-11-22T20:11:22+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:22+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:25+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:25+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:27+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:27+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 256 mods: 0 rune: 113"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 24 mods: 2 rune: 24"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 3 mods: 2 rune: 3"
time="2020-11-22T20:11:28+01:00" level=debug msg="killing signal-cli daemon..."

I can confirm signal-cli works, as I can receive messages using the cli. Moreover, I can send messages through signal-cli.

Am I doing something wrong, or did I find a bug?

@derricw
Copy link
Owner

derricw commented Nov 23, 2020

@beune

Haha yeah it is totally possible that you found a bug. So your TUI is empty because it couldn't read your contact list. Here are a couple questions for you, so we can fix this:

  1. what version of signal-cli are you running? You should be able to print it with signal-cli --version
  2. Is there a signal-cli data file at ~/.local/share/signal-cli/data/+<your-phone-number>

They just released a new version of signal-cli (0.6.12) and the changelog suggests that they may have moved the contact store, which could definitely be causing this problem: https://github.com/AsamK/signal-cli/blob/master/CHANGELOG.md

Also, siggo runs signal-cli in daemon mode, which requires dbus. The fact that your log file shows multiple attempts to start the daemon might indicate that you don't have dbus. Take a look here: https://github.com/AsamK/signal-cli/wiki/DBus-service

@derricw derricw self-assigned this Nov 23, 2020
@beune
Copy link
Author

beune commented Nov 23, 2020

  1. I am indeed running signal-cli 0.6.12
  2. There is indeed a data file present at that location.

Now when I try to run signal-cli in daemon mode, I get the following error:

$ signal-cli -u +xxxxxxxx daemon
Exception in thread "main" java.lang.RuntimeException: Cannot Resolve Session Bus Address
        at org.freedesktop.dbus.connections.impl.DBusConnection.lambda$getConnection$1(DBusConnection.java:257)
        at org.freedesktop.dbus.connections.impl.DBusConnection.getConnection(DBusConnection.java:165)
        at org.freedesktop.dbus.connections.impl.DBusConnection.getConnection(DBusConnection.java:228)
        at org.freedesktop.dbus.connections.impl.DBusConnection.getConnection(DBusConnection.java:184)
        at org.asamk.signal.commands.DaemonCommand.handleCommand(DaemonCommand.java:51)
        at org.asamk.signal.Main.handleCommands(Main.java:184)
        at org.asamk.signal.Main.handleCommands(Main.java:135)
        at org.asamk.signal.Main.main(Main.java:65)

I tried to make use of the system bus, but I do not have systemd on my linux distro, as I run OpenRC (a different init system). I also could not get this to work, as the signal-cli repo does not offer any OpenRC init files.

I already filed an issue in the signal-cli repo to provide those init files.

Is there anything I can do right now?

@derricw
Copy link
Owner

derricw commented Nov 23, 2020

You know, when I first started this project, I had a build that just ran signal-cli receive on a loop as a subprocess instead of using the dbus daemon. it worked fine but used too much resources since it was continually spinning up the jvm in the background.

I would love an alternative signal-cli command like receive_forever or something that just continually receives instead of doing it once then dying. If I were a better java programmer I would try to add that feature for them. That would eliminate our reliance on their dbus daemon for continually receiving messages.

@beune
Copy link
Author

beune commented Nov 23, 2020

Ah so that's what the daemon is for!

I think I'll have to wait until I get a response in the signal-cli repo. Or can you explain why I get the error when running $ signal-cli -u +xxxxxxxx daemon?

@derricw
Copy link
Owner

derricw commented Nov 23, 2020

Definitely seems most likely that you have no dbus service running. I have no idea how to get that running with OpenRC.

Might be something here: https://wiki.gentoo.org/wiki/D-Bus

@cycneuramus
Copy link

cycneuramus commented Dec 21, 2020

I'm having the same issue (i. e. siggo just gives me an empty TUI) even though signal-cli -u +xxxxxxxx daemon works fine on my end. So I suppose the problem has to do with the updates to the contacts store.

I'm on signal-cli 0.7.0.

@derricw
Copy link
Owner

derricw commented Dec 22, 2020

Hey! I have not tested siggo yet with signal-cli 0.7.X. I will try to very soon.

@Masacaai
Copy link

Masacaai commented Jan 5, 2021

Hi, I've got the same issue. My signal-cli daemon works fine though. I am on signal-cli 0.7.2

@derricw
Copy link
Owner

derricw commented Jan 25, 2021

Hey, after testing with signal-cli 0.7, I've made an update that may fix this problem. Could you try pulling master and rebuilding?

@beune
Copy link
Author

beune commented Jan 25, 2021

The empty TUI is gone, but now there is still a couple of problems:

  • Messages do not seem to be persistent. I can confirm they are not stored in .local/share/siggo/conversations, although save_messages is set to true.
  • Some chats are titled with a base64 like string: f4NyoBVaOJs9OZbBOstkKGxBm//gSv/8lYi02xn076U= <f4NyoBVaOJs9OZbBOstkKGxBm//gSv/8lYi02xn076U=. Edit: I suspect that this only happens to group chats.
  • When there are a lot of chats and you scroll down all chats, the selected chat dissapears. In other words, the chats do not move along with the selected chat cursor. Edit: More chats become visible as you resize the terminal.
  • Unread messages are not displayed at the top of the chat menu. Is this intentional?
  • I believe that in group chats, contact names only show up when you've had a personal chat with them. So if you have not sent a personal message to a person in a group, only their phone number is visible, even if you have them in your contacts.
  • Sometimes when you scroll between chats, some chats at the top of the screen swap in place.

Do you want me to file separate issues for this?

Info:

Build Date: 2021-01-25-09:20:30
Git Commit: cbe0210a74c9a004e35353b68f3c964eed342741
Version: 0.8.2
Go Version: go1.15.7
OS/Arch: linux amd64
signal-cli Version: 0.7.4

siggo config:

user_name: self
save_messages: true
desktop_notifications: false
desktop_notifications_show_message: false
desktop_notifications_show_avatar: false
terminal_bell_notifications: false
max_coversation_length: 0
hide_panel_titles: false
hide_phone_numbers: false
contact_colors: {}
contact_aliases: {}
log_file: ""

signal-cli 0.7.4

@derricw
Copy link
Owner

derricw commented Jan 25, 2021

Ok, well we're getting somewhere at least! Thanks for being patient with this. I need to build a good test suite for this stuff ><.

  1. I think there are some issues with saving messages (and adding conversations to the GUI) from people who were not initially loaded from the signal-cli data file.
  2. The base64 chats are group chat IDs. They should only show up with an ID like that if they group chat doesn't have a name in the signal-cli data file? I didn't think it was possible to not have a group name, but maybe it is? I'd love it if you could confirm that you have group names in your groupStore in ~/.local/share/signal-cli/data/<yournumber>
  3. Haha of course this happens. I have never had a contact list that full so I've never noticed this. I've opened up a bug for this: bug: Contact list doesn't scroll down with cursor #34
  4. This may not be possible to solve if signal-cli doesn't put the contact name in the data file somewhere for me to read.
  5. I think this is related to bug: dynamically-added contacts mess with contact list sorting #28 and the first issue on your list.

Thanks so much for troubleshooting this. I use this personally every day but my particular use cases dont surface some of these bugs.

@beune
Copy link
Author

beune commented Jan 25, 2021

  1. I can confirm that some groups in the groupStore have a name and a groupId, some only have a groupId. These same group names are also visible in siggo. However, I do not have any groups in my signal app that don't have a name. So for some reason some groups in signal-cli don't have a name.
  2. Ok that makes sense. Would it be better to make unread chats have a different color other than just a star? That makes them better to distinguish from read chats.
  3. Btw, I think that what I said is not true. You only see the names of people in group chats when they are on your signal homescreen. That means, you either sent them a message, or the person pops up on your homescreen with the message "Person is on Signal!"

No problem man, I would love to use siggo as my daily driver one day. Btw, do you have an explanation for issue 6?

@derricw
Copy link
Owner

derricw commented Jan 26, 2021

  1. I will have to come up with something nicer than the GroupID when a group doesn't have a name. Maybe shorten the members names or initials or something? Or just like group0, but let you alias them however you want (like the way it works with contact names).
  2. Yeah I'm open to suggestions on how to better differentiate chats with new messages. Currently they get a star and bold font. You can also instantly jump to chats with new messages with CTRL+n.
  3. I think issue 5, 6, and 1 are all related to the same bug, which is a problem with the way the contact sorting works after a contact has been added dynamically (not read from the signal-cli data file at startup).

@derricw derricw added the bug Something isn't working label Feb 2, 2021
@derricw
Copy link
Owner

derricw commented Feb 14, 2021

@beune 3. should be fixed. #34

@derricw
Copy link
Owner

derricw commented May 14, 2021

@beune 2. should be fixed #44

@derricw
Copy link
Owner

derricw commented May 14, 2021

I think I'm going to close this for now since the bugs we've discussed are either fixed or have their own issue entry.

@derricw derricw closed this as completed May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants