Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks for sending sms should appear in pending tray, before going to sent tray. #120

Closed
Nhorning opened this issue Aug 28, 2013 · 14 comments
Milestone

Comments

@Nhorning
Copy link

In current functionality, tasks for sending sms appear in the sent tray as soon as they are found on the server. After this toast popups appear similar to "sms sent" for each message in the sent tray, as well as "sms delivered" if they succeed in going through, and "sms sending failed, perhaps not enough balance on phone" if they fail.

The problem with this is that it's impossible to track which sms succeeded and which failed, so one can know which ones to try to resend, drop from subscription, etc.

I think an elegant solution would be to have all tasks appear in the pending tray when they are synced from the server. Once they are successfully sent, they should appear in the sent tray. Hitting the sync button would then try to resend these tasks if they have not been deleted.

@Nhorning
Copy link
Author

I will clarify here. In v2.5.1 the tasks now do not appear in either the pending tray or the sent tray. The only way to verify that a tasks was sent was in the "logs" tray. This is an improvement, in that it is now possible to verify that task were sent, and is better than the continual "toast" popups. However, I believe it would be much better if the functionality above was used, or at least an option that could be enabled.

@eyedol eyedol added this to the v2.6 milestone Apr 8, 2014
@tstalka
Copy link
Contributor

tstalka commented Apr 14, 2014

When message is synced from the server it should be sent automatically? If sanding fails it should appear in pending tray ?

@eyedol
Copy link
Collaborator

eyedol commented Apr 14, 2014

@tstalka Yes.

@tstalka
Copy link
Contributor

tstalka commented Apr 18, 2014

Messages in pending tray doesn't have a bottom label like messages in sent tray(pending/task).
When sending fails and task appear in the pending tray it should has a label with word "task"? Should pending messages have label too ?

@Nhorning
Copy link
Author

@tstalka, eyedol and I had a talk about how "pending" will always be confused with "not sent." The idea is to rename "pending/task" to something else that indicates that one is being sent from the sim, and one is being received by the sim. These labels should be the same in both the pending and the sent tray.

@eyedol
Copy link
Collaborator

eyedol commented Apr 19, 2014

Yes as sms to differentiate the two properly.

@tstalka
Copy link
Contributor

tstalka commented Apr 23, 2014

When we synchronizing the messages from the pending tray we don't know that task were successfully resend. We know that only in https://github.com/ushahidi/SMSSync/blob/develop/smssync/src/main/java/org/addhen/smssync/fragments/PendingMessages.java#L92 . When task is sent, it disapear from the pending tray. When resending fails BroadcastReceiver will put task there again.
Is it a good solution?

@Nhorning
Copy link
Author

How about this instead:

All messages (both tasks and sms) start in the pending tray once the smsync becomes aware of them)

All messages that have had a send attempted (both to the server and phone numbers) disappear from the pending tray and appear in the sent tray.

If no confirmation of success for a sent message has been received, it is marked "unconfirmed" in the sent tray.

If the message sending fails, it is returened to the pending tray and marked "failed".

Holding down on a message in either tray gives a menu option to resend it.

@mandric
Copy link
Collaborator

mandric commented Apr 25, 2014

FYI I have a doc outlining this and a volunteer working on it, should have a WIP branch or PR next week. https://gist.github.com/mandric/11287748 Feedback appreciated.

@tstalka
Copy link
Contributor

tstalka commented Apr 29, 2014

@mandric
To be sure task received from the server should be sent automatically or stored in the pending tray?
When task has been sent but Receiver wasn't triggered task should be moved to sent tray with label unconfirmed, then when Receiver result is ok the label is update to task otherwise task will be moved to the pending tray with label failed.

One thing i have noticed that the Activity.RESULT_OK is -1
so fields sent_result_code and delivery_result_code should be still initalize with value -1?

@mandric
Copy link
Collaborator

mandric commented Apr 30, 2014

@tstalka

It makes sense to put all sent messages in the sent tray then update their labels and then only move messages to pending if they failed to send. Does that cause more problems on the implementation side?

I didn't realize Activity.RESULT_OK is -1 sorry about that. I thought it was 0. So maybe we should just initialize it to null? I defer to your judgement.

@Nhorning
Copy link
Author

@mandric @tstalka

Potentially how much time is there between when a message is received from the server and a send is attempted (And it appears in the log)? If this is always instantaneous, I think tasks received from the server should start in the "sent" tray. If they are processed one at a time with a few seconds delay, I think they should start out in the "pending tray" until they are sent, at which point they would appear in the "sent" tray instead.

@mandric
Copy link
Collaborator

mandric commented Apr 30, 2014

@Nhorning they should be processed/sent right away so they will only end up in pending if they failed to send.

tstalka pushed a commit to tstalka/SMSSync that referenced this issue May 5, 2014
tstalka pushed a commit to tstalka/SMSSync that referenced this issue May 5, 2014
tstalka pushed a commit to tstalka/SMSSync that referenced this issue May 5, 2014
eyedol added a commit that referenced this issue May 11, 2014
#120 - Tasks for sending sms should appear in pending tray, before going to sent tray.
@KamilKalfas
Copy link
Contributor

@eyedol please close this since you've merged PR #161

@eyedol eyedol closed this as completed May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants