textbee icon indicating copy to clipboard operation
textbee copied to clipboard

SMS Gateway (Queue) issue - Penultimate SMS Messages being Delivered

Open parg0 opened this issue 11 months ago • 4 comments

Description: When a user creates new SMS message to be sent to a specific phone number, if the SMS isn’t received on the first attempt, creating and sending a new message delivers the first one. SMS gateway sends the message from the first attempt instead of the newly generated one. This indicates a likely issue with the SMS gateway’s message queue handling, where stale messages are not being replaced or properly dequeued.

Steps to Reproduce: 1. User creates new sms message in textbee.dev/dashboard, enters recepient number 2. Notification is shown that SMS message was successfully sent 3. User does not receive SMS message. 4. User tries again by creating new SMS message for same phone number. 5. Notification is shown that SMS message was successfully sent 6. SMS gateway sends the message from the first attempt instead of the new one. User receives first message. 7. Behaviour perpetiates with each newly created SMS...

It's not a delay (telecom provider) issue, as the SMS is received almost imediatelly after second user entry no matter the amount of delay between entries: 1 minute, 2 minutes, 10 minutes...

video of the behaviour with a custom built app: https://youtu.be/1PMPNyWxSqE

Expected Behavior: The SMS gateway should always send the latest message corresponding to the most recent request.

Actual Behavior: The SMS gateway sends an outdated SMS message from the previous attempt.

parg0 avatar Mar 06 '25 10:03 parg0

@parg0 i believe both sms should have been sent in this case, if i understand you correctly, the first sms is not delivered right? could you share the response/ logs for the initial attempt?

vernu avatar Mar 06 '25 18:03 vernu

Correct. First message was not delivered initially. Then when second message is passed to textbee API, the first one gets delivered. When a third one is passed, the second one gets delivered and so on... and once again, I was not sure if it had something to do with the telecom provider so i tested with various delays between each message spanning from a few seconds to several minutes. The result was immediate delivery of the previously sent message in a span of 2-3 seconds a new one was passed to textbee API.

I'm afraid I don't have the logs. But I tested in both my application and Textbee dashboard. Result was the same.

parg0 avatar Mar 07 '25 08:03 parg0

@parg0 I’m not sure what’s causing this issue, as I haven’t been able to reproduce it on my end. Could you double-check if your SMS sending logic might be causing this issue?

vernu avatar Mar 08 '25 14:03 vernu

@vernu can't be my logic as I am not using any type of queue, I'm contacting the API endpoint immediately and sending the message. Also, before opening this ticket I was able to confirm the issue even by sending a message trough textbee.dev dashboard.

Let's bury it for the time being and if it pops up again, i'll make sure to contact you directly on Discord.

parg0 avatar Mar 12 '25 10:03 parg0