[GH-ISSUE #398] SmsReceiverService is not thread-safe #285

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

Originally created by @alxndrsn on GitHub (Apr 6, 2016).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/398

In the SmsReceiverService, the sms property is class-scoped. It is only used in the handleSmsReceived() method. Therefore if multiple calls to this method are executing simultaneously on different threads but on the same instance of SmsReceiverService, there is a chance that they could end up processing the same message multiple times, and ignoring other messages.

Originally created by @alxndrsn on GitHub (Apr 6, 2016). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/398 In the [`SmsReceiverService`](https://github.com/ushahidi/SMSSync/blob/master/smssync/src/main/java/org/addhen/smssync/presentation/service/SmsReceiverService.java#L93), the `sms` property is class-scoped. It is only used in the [`handleSmsReceived()`](https://github.com/ushahidi/SMSSync/blob/master/smssync/src/main/java/org/addhen/smssync/presentation/service/SmsReceiverService.java#L248) method. Therefore if multiple calls to this method are executing simultaneously on different threads but on the same instance of `SmsReceiverService`, there is a chance that they could end up processing the same message multiple times, and ignoring other messages.
kerem closed this issue 2026-02-28 01:24:00 +03:00
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#285
No description provided.