[GH-ISSUE #452] Imported messages not getting published on Lollipop devices #313

Open
opened 2026-02-28 01:24:06 +03:00 by kerem · 0 comments
Owner

Originally created by @vanso-hubsi on GitHub (Jun 29, 2016).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/452

Expected behavior

Imported messages to be published and moved to the Published folder

Actual behavior

Imported messages don't get published

Steps to reproduce the behavior

Import messages on a device running Android >Kitkat

Notes

With the scenario described above, creating the publish request fails and SMSSync throws the following error when trying to publish an imported message:

E/org.addhen.smssync.data.net.MessageHttpClient: Failed to set request body
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
    at com.squareup.okhttp.FormEncodingBuilder.add(FormEncodingBuilder.java:38)

That null object seems to be a missing value for the message_id key - it seems imported messages don't get a uuid on import.
The code different for import on devices >Kitkat: In contrast to Kitkat imports (ProcessSms.java#L174), messages imported on Lollipop devices don't get a uuid (ProcessSms.java#L210).

Though this empty line indicates that this is explicitly wanted, copying the line from Kitkat above solved the issue for us.

Originally created by @vanso-hubsi on GitHub (Jun 29, 2016). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/452 ### Expected behavior Imported messages to be published and moved to the Published folder ### Actual behavior Imported messages don't get published ### Steps to reproduce the behavior Import messages on a device running Android >Kitkat ### Notes With the scenario described above, creating the publish request fails and SMSSync throws the following error when trying to publish an imported message: ``` E/org.addhen.smssync.data.net.MessageHttpClient: Failed to set request body java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at com.squareup.okhttp.FormEncodingBuilder.add(FormEncodingBuilder.java:38) ``` That _null_ object seems to be a missing value for the message_id key - it seems imported messages don't get a uuid on import. The code different for import on devices >Kitkat: In contrast to Kitkat imports ([ProcessSms.java#L174](https://github.com/ushahidi/SMSSync/blob/54951c1794e24f74e12b3df704fe35b6ddb65efd/smssync/src/main/java/org/addhen/smssync/smslib/sms/ProcessSms.java#L174)), messages imported on Lollipop devices don't get a uuid ([ProcessSms.java#L210](https://github.com/ushahidi/SMSSync/blob/54951c1794e24f74e12b3df704fe35b6ddb65efd/smssync/src/main/java/org/addhen/smssync/smslib/sms/ProcessSms.java#L210)). Though this empty line indicates that this is explicitly wanted, copying the line from Kitkat above solved the issue for us.
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#313
No description provided.