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

confirm success of upload #598

Closed
matkoniecz opened this issue Sep 27, 2017 · 8 comments
Closed

confirm success of upload #598

matkoniecz opened this issue Sep 27, 2017 · 8 comments

Comments

@matkoniecz
Copy link

it may be desirable to display toast confirming that report was successfully send (or that sending failed)

reported from downstream - MarcusWolschon/osmeditor4android#605 (comment)

@F43nd1r
Copy link
Member

F43nd1r commented Sep 27, 2017

That option exists, if you are using dialog mode: use resDialogOkToast

@simonpoole
Copy link

simonpoole commented Oct 8, 2017

resDialogOkToast only shows a confirmation when the user has submitted a report, independently of if it could actually be submitted to the destination for such reports (I had a look at the code and there is no provision for notifying on successful/failed upload).

@F43nd1r
Copy link
Member

F43nd1r commented Oct 8, 2017

I've added toast options to version 5.0.0-alpha10: https://github.com/F43nd1r/acra/blob/modules/acra-core/src/main/java/org/acra/annotation/AcraCore.java#L415

As this is in alpha stage, the changes needed to use it are not well documented, but if you post your configuration here, I'll transform it.

@simonpoole
Copy link

@F43nd1r glad to test as soon as I've worked through the current pile of hi-prio items, current config:

@ReportsCrashes(
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
formUri = "http://acralyzer.vespucci.io/acraproxy",
mode = ReportingInteractionMode.DIALOG,
resDialogText = R.string.crash_dialog_text,
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
resDialogTheme = R.style.Theme_AppCompat_Light_Dialog)

@F43nd1r
Copy link
Member

F43nd1r commented Oct 9, 2017

@AcraCore(resReportSendSuccessToast = /*new string resource, optional*/,
        resReportSendFailureToast = /*new string resource, optional*/)
@AcraHttpSender(
        reportType = HttpSender.Type.JSON,
        httpMethod = HttpSender.Method.POST,
        uri = "http://acralyzer.vespucci.io/acraproxy")
@AcraDialog(
        resText = R.string.crash_dialog_text,
        resCommentPrompt = R.string.crash_dialog_comment_prompt,
        resTheme = R.style.Theme_AppCompat_Light_Dialog)

and these are the required dependencies:

 compile 'com.faendir.acra:acra-http:5.0.0-alpha11'
 compile 'com.faendir.acra:acra-dialog:5.0.0-alpha11'

@F43nd1r F43nd1r closed this as completed Nov 16, 2017
@simonpoole
Copy link

@F43nd1r I've updated the dependency to 5.0.0 and changed the config, to

@AcraCore(resReportSendSuccessToast = R.string.report_success, resReportSendFailureToast = R.string.report_failure)
@AcraHttpSender(httpMethod = HttpSender.Method.POST, uri = "http://acralyzer.vespucci.io/acraproxy")
@AcraDialog(resText = R.string.crash_dialog_text, resCommentPrompt = R.string.crash_dialog_comment_prompt, resTheme = R.style.Theme_AppCompat_Light_Dialog)

Which works fine, except that it doesn't actually display the toasts after successfully or unsuccessfully submitting a report.

@F43nd1r
Copy link
Member

F43nd1r commented Jan 10, 2018

Can confirm this issue. Problem is the thread dies before the toast is sent.
Related stacktrace

W/MessageQueue: Handler (android.widget.Toast$TN$1) {3862f92} sending message to a Handler on a dead thread
                                                                         java.lang.IllegalStateException: Handler (android.widget.Toast$TN$1) {3862f92} sending message to a Handler on a dead thread
                                                                             at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
                                                                             at android.os.Handler.enqueueMessage(Handler.java:661)
                                                                             at android.os.Handler.sendMessageAtTime(Handler.java:630)
                                                                             at android.os.Handler.sendMessageDelayed(Handler.java:600)
                                                                             at android.os.Handler.sendMessage(Handler.java:537)
                                                                             at android.os.Message.sendToTarget(Message.java:418)
                                                                             at android.widget.Toast$TN.hide(Toast.java:441)
                                                                             at android.app.ITransientNotification$Stub.onTransact(ITransientNotification.java:57)
                                                                             at android.os.Binder.execTransact(Binder.java:674)

@F43nd1r
Copy link
Member

F43nd1r commented Jan 28, 2018

Hopefully finally fixed in 5.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants