[GH-ISSUE #237] Setting the number of retries for a message #173

Closed
opened 2026-02-28 01:23:32 +03:00 by kerem · 10 comments
Owner

Originally created by @sorinpohontu on GitHub (Jan 24, 2015).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/237

Originally assigned to: @eyedol on GitHub.

When sending a message and it will fail for various reasons, the message will be in Pending state for a undefined number of retries.

I'm thinking about adding in Settings a new variable for Number of retries for a message.
After specified number of retries is reached, the message should be deleted from Pending state.

Also, if "Message Results API" is enabled, it should respond to server in order to set it as Error and stop processing further.

Originally created by @sorinpohontu on GitHub (Jan 24, 2015). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/237 Originally assigned to: @eyedol on GitHub. When sending a message and it will fail for various reasons, the message will be in Pending state for a undefined number of retries. I'm thinking about adding in Settings a new variable for Number of retries for a message. After specified number of retries is reached, the message should be deleted from Pending state. Also, if "Message Results API" is enabled, it should respond to server in order to set it as Error and stop processing further.
kerem 2026-02-28 01:23:32 +03:00
Author
Owner

@sorinpohontu commented on GitHub (Feb 17, 2015):

Additional note: If the message fails, it should be send only once and after that, let the Message API (server side) to retry the message, if needed.

In this way, the logic in SMSSync should be easier to implement.

Looking forward for feedback.

<!-- gh-comment-id:74702005 --> @sorinpohontu commented on GitHub (Feb 17, 2015): Additional note: If the message fails, it should be send only once and after that, let the Message API (server side) to retry the message, if needed. In this way, the logic in SMSSync should be easier to implement. Looking forward for feedback.
Author
Owner

@eyedol commented on GitHub (Feb 23, 2015):

@sorinpohontu what will make the app not send the SMS? Wrong formatted phone number? There would be some edge cases where the phone number is correctly formatted but doesn't exist. If it's wrong formatted, I can just drop attempt at sending a SMS to it.

<!-- gh-comment-id:75492770 --> @eyedol commented on GitHub (Feb 23, 2015): @sorinpohontu what will make the app not send the SMS? Wrong formatted phone number? There would be some edge cases where the phone number is correctly formatted but doesn't exist. If it's wrong formatted, I can just drop attempt at sending a SMS to it.
Author
Owner

@sorinpohontu commented on GitHub (Feb 23, 2015):

There might be various reasons:

  • Wrong number format
  • Number not exists
  • Number is correct, but is not a GSM number
  • Insufficient credit on SIM (for prepay numbers)
  • No GSM coverage / signal

SMSSync will need to:

  • Set the number of retries for a message (eg, try N times and after that do not send anymore)
  • Or always send it once, and if it fails let the Response API (Server) to make a decision if it will be re-queued

Looking forward to hear from you.

<!-- gh-comment-id:75506969 --> @sorinpohontu commented on GitHub (Feb 23, 2015): There might be various reasons: - Wrong number format - Number not exists - Number is correct, but is not a GSM number - Insufficient credit on SIM (for prepay numbers) - No GSM coverage / signal SMSSync will need to: - Set the number of retries for a message (eg, try N times and after that do not send anymore) - Or always send it once, and if it fails let the Response API (Server) to make a decision if it will be re-queued Looking forward to hear from you.
Author
Owner

@eyedol commented on GitHub (Mar 3, 2015):

Still WIP. This is a tricky one because of the way we process SMSs. Still working on it.

<!-- gh-comment-id:76897209 --> @eyedol commented on GitHub (Mar 3, 2015): Still WIP. This is a tricky one because of the way we process SMSs. Still working on it.
Author
Owner

@sorinpohontu commented on GitHub (Mar 3, 2015):

Adding a new field in table 'messages', let's say message_no_of_retries would help.
After that, for send it's a just a simple query to select messages with message_no_of_retries <= Preferences.no_of_retries. After send, message_no_of_retries should be incremented and it will be not processed on next send.

In Message Result API, messages with message_no_of_retries >= Preferences.no_of_retries should be returned as not delivered (maybe a JOIN with sent_messages).

Please let me know if you need more info.

Looking forward to hear from you.

<!-- gh-comment-id:76910175 --> @sorinpohontu commented on GitHub (Mar 3, 2015): Adding a new field in table 'messages', let's say message_no_of_retries would help. After that, for send it's a just a simple query to select messages with `message_no_of_retries` <= Preferences.no_of_retries. After send, message_no_of_retries should be incremented and it will be not processed on next send. In Message Result API, messages with message_no_of_retries >= Preferences.no_of_retries should be returned as not delivered (maybe a JOIN with sent_messages). Please let me know if you need more info. Looking forward to hear from you.
Author
Owner

@eyedol commented on GitHub (Apr 20, 2015):

@sorinpohontu could you confirm this is fixed in v2.8.0-rc.1?

<!-- gh-comment-id:94455990 --> @eyedol commented on GitHub (Apr 20, 2015): @sorinpohontu could you confirm this is fixed in [v2.8.0-rc.1](https://github.com/ushahidi/SMSSync/releases/tag/v2.8.0-rc.1)?
Author
Owner

@sorinpohontu commented on GitHub (Apr 20, 2015):

@eyedol Seems to work as expected, but I'll have to double check tomorrow and get back to you.

<!-- gh-comment-id:94466609 --> @sorinpohontu commented on GitHub (Apr 20, 2015): @eyedol Seems to work as expected, but I'll have to double check tomorrow and get back to you.
Author
Owner

@sorinpohontu commented on GitHub (Apr 21, 2015):

Settings: "No. of retries for pending message" = Three tries.
Actually, the message is sent 5 times. Can you recheck ?

<!-- gh-comment-id:94655366 --> @sorinpohontu commented on GitHub (Apr 21, 2015): Settings: "No. of retries for pending message" = Three tries. Actually, the message is sent 5 times. Can you recheck ?
Author
Owner

@eyedol commented on GitHub (Apr 21, 2015):

How many messages were in the queue? They got deleted after the 5th retries?

<!-- gh-comment-id:94695838 --> @eyedol commented on GitHub (Apr 21, 2015): How many messages were in the queue? They got deleted after the 5th retries?
Author
Owner

@sorinpohontu commented on GitHub (Apr 21, 2015):

2 Messages, 1 correct and 1 wrong. The wrong message was deleted from Pending after 5th retry.
I've made another test with a single message in the queue, and the failed message has also 5 retries.

<!-- gh-comment-id:94699732 --> @sorinpohontu commented on GitHub (Apr 21, 2015): 2 Messages, 1 correct and 1 wrong. The wrong message was deleted from Pending after 5th retry. I've made another test with a single message in the queue, and the failed message has also 5 retries.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#173
No description provided.