signal-cli-rest-api: [v.0.131-dev] WebSocket connection seems to misbehave

The problem

As discussed in https://github.com/bbernhard/signal-cli-rest-api/issues/444#issuecomment-1815686274

In my deployment i use 2 linked numbers and 3 directly registered ones.

I use signalbot and spawn for each number a separate thread (multiprocessing.Process). The behavior should be the same like if i run the signalbot two times for different numbers.

This used to work with the stable old version v0.70 and prior. (in jsonRPC mode) Not sure how familiar you are with this python module but it establishes an websocket to fetch new messages. So there are 4 open connections (one number unused).

I send a message to each number quickly one after another and only one responses; other time another does respond.

Do you know if it is related to the speed you are sending those messages?

It is not related to speed, some messages simply wont get through.

Test: I send from the same number to all three dedicated numbers in exactly that order:

  • number 1 receives “a normal tip-speed spam of ones to trigger ‘start typing event’” -> message: 1111111111111111111111111111111111
  • number 2 receives “a tip-speed spam of twos to trigger ‘start typing event’”
  • number 3 receives “a tip-speed spam of threes to trigger ‘start typing event’”

i did not count how often i pressed the number. but always at least 20 times. maybe i was typing two to tree numbers a second. furthermore i did not hurry to switch to the other chat.

2023-11-17 05:27:15,040 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195236085,"typingMessage":{"action":"STARTED","timestamp":1700195236085}},"account":"+4922222222222"}
2023-11-17 05:27:31,418 - root - INFO - [Raw Message] {"envelope":{"source":"+4933333333333","sourceNumber":"+4933333333333","sourceUuid":"TheSourceUuid","sourceName":"+4933333333333","sourceDevice":1,"timestamp":1700195251155,"receiptMessage":{"when":1700195251155,"isDelivery":true,"isRead":false,"isViewed":false,"timestamps":[1700195252435]}},"account":"+49123456789"}
2023-11-17 05:27:40,746 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195262058,"typingMessage":{"action":"STARTED","timestamp":1700195262058}},"account":"+4911111111111"}
2023-11-17 05:27:44,474 - root - INFO - [Raw Message] {"envelope":{"source":"+4911111111111","sourceNumber":"+4911111111111","sourceUuid":"TheSourceNumber","sourceName":"+4911111111111","sourceDevice":1,"timestamp":1700195264206,"receiptMessage":{"when":1700195264206,"isDelivery":true,"isRead":false,"isViewed":false,"timestamps":[1700195265500]}},"account":"+49123456789"}
2023-11-17 05:27:56,567 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195277843,"dataMessage":{"timestamp":1700195277843,"message":"222222222222222222222222222","expiresInSeconds":604800,"viewOnce":false}},"account":"+4922222222222"}

the module only registered two “start typing events” and received only one message. and in a wrong order (not an issue at all but interesting)

for consistency i wrote the comment to this point and repeated the whole procedure whiteout changing the setup.

2023-11-17 05:37:20,260 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195841568,"typingMessage":{"action":"STARTED","timestamp":1700195841568}},"account":"+4911111111111"}
2023-11-17 05:37:25,319 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195845482,"syncMessage":{"sentMessage":{"destination":"+4911111111111","destinationNumber":"+4911111111111","destinationUuid":"TheDestinationUuid","timestamp":1700195845482,"message":"111111111111111111111","expiresInSeconds":604800,"viewOnce":false}}},"account":"+49123456789"}
2023-11-17 05:37:33,305 - root - INFO - [Raw Message] {"envelope":{"source":"+49123456789","sourceNumber":"+49123456789","sourceUuid":"TheSourceNumber","sourceName":"TheSourceName","sourceDevice":2,"timestamp":1700195854576,"dataMessage":{"timestamp":1700195854576,"message":"2222222222222222222222222222222","expiresInSeconds":604800,"viewOnce":false}},"account":"+4922222222222"}

here i got again not all “typing started” events and one message.

Are you using the latest released version?

  • Yes

Have you read the troubleshooting page?

  • Yes

What type of installation are you running?

signal-cli-rest-api Docker Container

In which mode are you using the docker container?

JSON-RPC Mode

What’s the architecture of your host system?

x86-64

Additional information

No response

EDIT: “syncMessage” and “receiptMessage” do make sense because the sending number is also an used linked device

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@bbernhard You are awesome. For me it works now. Thank you.