mirror of
https://github.com/ushahidi/SMSSync.git
synced 2026-04-26 00:05:57 +03:00
[GH-ISSUE #60] messages that get the same ID are skipped #52
Labels
No labels
Bug report
Code improvement
Concern
Feature request
Feature request
Good first issue to work on
In progress
Needs info
Question
Ready
Translation
User Experience
User Experience
Website
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SMSSync#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mandric on GitHub (Nov 20, 2012).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/60
i'm investigating the case where messages arrive into smssync and if the sync url is not valid SMSSync can hang up to the connection timeout value (currently 60 seconds) during that time if another message arrives it gets the same messageId and therefore gets skipped during syncing and also never appears in the pending list.
@mandric commented on GitHub (Nov 21, 2012):
The problem is likely here: https://github.com/ushahidi/SMSSync/blob/master/smssync/src/org/addhen/smssync/ProcessSms.java#L384
@ghost commented on GitHub (Nov 22, 2012):
Well, it seems that messages are getting same ids most of the time:
Why not just generate a hash of the message and use that as the ID?
@eyedol commented on GitHub (Nov 23, 2012):
@agenttihirvinen probably a better idea than to rely on the system's message ID. Instead of generating a hash of the message, I would rather use the
idfield in the database. That is can be unique than the hash of the message. Imagine if the same number sends the same message?@mandric commented on GitHub (Nov 27, 2012):
I think that
processSms.getIdis a problem inside ofhandleSmsReceived. We really want to wait until the new sms is saved by android and then use the saved data to save the smsmessage model with known_idandthread_id. Then create a Pending message and fire off an event or task to process the pending message.@ghost commented on GitHub (Nov 27, 2012):
@eyedol: The problem is, it is not unique. Most of the time 0 is returned, which is rather useless for identifying messages. It MUST be reliably unique to be of any use. Now I have to do hash checking on the server side to protect against reposts(messages comes in on the server side, gets processed, apparently connection times out occasionally or something before SMSSync gets the reply, and so sends the message again a few minutes later. Not very nice in cases where a message contains a command to forward it to 200 people. Especially if it happens five times in a row... ;)
@eyedol commented on GitHub (Feb 11, 2013):
@mandric I think using
UUID.randomUUID().toString()which is in the Util package should be an ideal solution to get a unique ID. The current implementation of getting a unique ID isn't reliable. What do you think?@mandric commented on GitHub (Feb 11, 2013):
Sounds good.
Also I'm not sure if this relates, but I've had reports that some messages never get into the Android Messages inbox, so you get messages that have been processed by smssync but do not exist anywhere on the android device.
@eyedol commented on GitHub (Feb 11, 2013):
I haven't hit that yet.
I'm going to drop the
_idcolumn and replace that withmessage_idfield to hold the UUID value.