isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
432 stars 40 forks source link

Messages from phone do not show up in scli #187

Closed Jehops closed 1 year ago

Jehops commented 2 years ago

Starting with scli 0.7.0 (I believe)

messages that I send from the Signal Android application that I used to link with scli do not show up in scli.

If I send a message from Android without scli running, and do signal-cli -u +1XXXXXXXXXX receive from my laptop, the output looks like this

Envelope from: unknown source
Timestamp: 1648519729778 (2022-03-29T02:08:49.778Z)
Sent by unidentified/sealed sender
Sender: “⁨XXX_NOT_ME” +1XXX_NOT_ME (device: 2)
Server timestamps: received: 1648519729808 (2022-03-29T02:08:49.808Z) delivered: 1648519741970 (2022-03-29T02:09:01.970Z)
Received a receipt message
  When: 1648519729778 (2022-03-29T02:08:49.778Z)
  Is delivery receipt
  Timestamps:
  - 1648519729813 (2022-03-29T02:08:49.813Z)

Envelope from: “ME” +1XXX_ME_ (device: 1)
Timestamp: 1648519729813 (2022-03-29T02:08:49.813Z)
Sender: “ME” +1XXX_ME_ (device: 1)
Server timestamps: received: 1648519729897 (2022-03-29T02:08:49.897Z) delivered: 1648519741970 (2022-03-29T02:09:01.970Z)
Received a sync message
Received sync sent message
  To: “⁨XXX_NOT_ME⁩” +1XXX_NOT_ME
  Timestamp: 1648519729813 (2022-03-29T02:08:49.813Z)
  Message timestamp: 1648519729813 (2022-03-29T02:08:49.813Z)
  Body: This is the text of the message.
  Profile key update, key length: 32

Envelope from: unknown source
Timestamp: 1648519729325 (2022-03-29T02:08:49.325Z)
Sent by unidentified/sealed sender
Sender: “⁨XXX_NOT_ME⁩” +1XXX_NOT_ME (device: 1)
Server timestamps: received: 1648519731751 (2022-03-29T02:08:51.751Z) delivered: 1648519741971 (2022-03-29T02:09:01.971Z)
Received a receipt message
  When: 1648519729325 (2022-03-29T02:08:49.325Z)
  Is delivery receipt
  Timestamps:
  - 1648519729813 (2022-03-29T02:08:49.813Z)

Messages that I send from scli still show up in the Signal Android application and messages that I receive still show up in both the Signal Android application and scli.

This is using the scli package on FreeBSD.

vargn commented 2 years ago

I also have this issue. Messages sent from my android signal app doesn't show up in 1 on 1 conversations. But they do show up in group conversations.

I'm pretty sure that i'm also using the 0.7.0 release on Arch.

Jehops commented 2 years ago

Interesting. Group messages sent from my phone also show up in scli, as expected.

I should also mention that I'm running signal-cli-0.9.0. A friend who is running scli 0.7.1 and signal-cli-0.10.5 (on Arch) does not see this problem.

exquo commented 2 years ago

Can reproduce with signal-cli v0.9.0. Not a problem with some more recent versions, including the current v0.10.5. The issue is the destination field in the syncMessage's envelope in v0.9.0 contains the contact's UUID rather than a phone number:

{'envelope': {
              ...
              'syncMessage': {'sentMessage': {
                                            ...
                                            'destination': '..-UUID-HERE-..',
                                            ...

This field should contain a phone number, and it does so in newer versions of signal-cli. I believe it used to be the same with v0.9.0 until some recent time, because the relevant parts of scli's code have not changed. Maybe there has been a change in signal-server's messages that signal-cli has adjusted to.

The contacts in scli are indexed by their phone numbers rather than UUIDs. It would be possible to search by UUID also. But a better solution for this issue would be to update signal-cli. I can bump the requirement in scli's readme. @0mp would you be able to update signal-cli version in the BSD ports?

vargn commented 2 years ago

I just now updated to scli 0.7.1 and signal-cli 0.10.5, but this is still a issue for me. Or am I missing something? I shouldn't have to re-link or do anything else to enforce the use of the new signal-cli package?

exquo commented 2 years ago

I don't think re-linking should be necessary. Could you run scli with --debug and paste the logs output (~/.local/share/scli/log) with the sync message (remember to remove private info such as phone numbers).

vargn commented 2 years ago
DEBUG:root:callf: `['signal-cli', '-u', '+467xxxxxxxx', '--output=json', 'daemon']`
INFO:root:daemon_log: INFO DaemonCommand - Exported dbus object: /org/asamk/Signal
INFO:root:signal-cli dbus service started
INFO:root:signal-cli 0.8.1
DEBUG:root:Daemon: json_data = 
{'envelope': {'source': '+467xxxxxxxx',
              'sourceDevice': 1,
              'syncMessage': {'sentMessage': {'attachments': [],
                                              'contacts': [],
                                              'destination': '8b150892-8df0-48a9-bf73-64d58a5127bd',
                                              'expiresInSeconds': 0,
                                              'mentions': [],
                                              'message': 'xxxxxx',
                                              'timestamp': 1650033787739,
                                              'viewOnce': False}},
              'timestamp': 1650033787739}}
INFO:root:Setting status = `sending` for timestamp = 1650033787739
INFO:root:Setting status = `sent` for timestamp = 1650033787739
DEBUG:root:Daemon: json_data = 
{'envelope': {'receiptMessage': {'isDelivery': True,
                                 'isRead': False,
                                 'timestamps': [1650033787739],
                                 'when': 1650033789677},
              'source': '+467xxxxxxxx',
              'sourceDevice': 1,
              'timestamp': 1650033789677}}
INFO:root:Setting status = `delivered` for timestamp = 1650033787739
DEBUG:root:signal-cli account: linked device
exquo commented 2 years ago

INFO:root:signal-cli 0.8.1

Make sure signal-cli in your $PATH is the right version.

which signal-cli
signal-cli --version
vargn commented 2 years ago

Well this was embarrasing. Even tho I read thru the log several times this never caught my eye. Apparently I installed signal-cli by downloading the bin from github. This had slipped my mind, and for some reason I had the signal-cli package from AUR installed already. So I upgraded that one, and that is what caused all this confusion.

Thanks for holding my hand. I've upgraded the bin and I can now see my messages sent from the android app.

exquo commented 2 years ago

No problem! Happens to the best of us :)

exquo commented 1 year ago

The Signal servers don't work with older versions of signal-cli anymore (https://github.com/AsamK/signal-cli/issues/1022), so it has to be updated anyway.