ACRA/acra

ReportSender called twice when foreground service is active

F43nd1r opened this issue · 2 comments

Describe the bug
As reported here https://stackoverflow.com/questions/75418769/acra-5-9-sends-http-error-report-multiple-times report senders may be called twice when the application process is immediately restarted due to an active foreground service.

Expected behavior
Report is only sent once.

Possible line at fault https://github.com/ACRA/acra/blob/master/acra-core/src/main/java/org/acra/startup/StartupProcessorExecutor.kt#L47

Version

  • Android: ?
  • ACRA: 5.9

Thx for follow up. I tested with Android 12.

ACRA.init() is done in MyApplication.attachBaseContext(). Is it a right place?

Should I check ACRA.isACRASenderServiceProcess() prior to calling ACRA.init() ?

ACRA.init() is done in MyApplication.attachBaseContext(). Is it a right place?

Yes.

Should I check ACRA.isACRASenderServiceProcess() prior to calling ACRA.init() ?

ACRA.init already checks your process. You only need to add checks when you're doing other things on process startup.


I've pushed a fix which will be included in the next release.