Skip to content

HttpSender sends an empty body in ACRA 5.11.1 #1252

@aloz77

Description

@aloz77

Describe the bug
After update to ACRA 5.11.1 the request body (HTTP POST content) sent by HttpSender is empty.

Expected behavior
The request body contains all information about the crash. No issues with ACRA 5.11.0

Code to reproduce

ACRA.init(this, new CoreConfigurationBuilder()
                   .withBuildConfigClass(BuildConfig.class)
                   .withReportFormat(StringFormat.KEY_VALUE_LIST)
                   .withPluginConfigurations(
                           new ToastConfigurationBuilder()
                                   .withText(getString(R.string.crash_toast_text))
                                   .build()
                           )
                   .withPluginConfigurations(
                           BuildConfig.DEBUG ?
                           new LimiterConfigurationBuilder()
                                   .withPeriod(1)
                                   .withPeriodUnit(TimeUnit.DAYS)
                                   .withOverallLimit(250)
                                   .withExceptionClassLimit(100)
                                   .withStacktraceLimit(50)
                                   .withFailedReportLimit(50)
                                   .withIgnoredCrashToast("App stopped working again")
                                   .build() :
                           new LimiterConfigurationBuilder()
                                   .withPeriod(7)
                                   .withPeriodUnit(TimeUnit.DAYS)
                                   .withOverallLimit(25)
                                   .withExceptionClassLimit(10)
                                   .withStacktraceLimit(5)
                                   .withFailedReportLimit(5)
                                   .withIgnoredCrashToast("App stopped working again")
                                   .build()
                   )
                   .withPluginConfigurations(
                           new HttpSenderConfigurationBuilder()
                                   .withConnectionTimeout(8000)
                                   .withDropReportsOnTimeout(true)
                                   .withUri(getCrashReporturl(""))
                                   // Disable it by config in order to enable it in the custom HttpSender
                                   .withEnabled(false)
                                   .build()
                   )
                   .withReportContent(fields)
@AutoService(ReportSenderFactory.class)

public class MyCrashSenderFactory implements ReportSenderFactory {

    @NonNull
    public ReportSender create(@NonNull Context context, @NonNull CoreConfiguration config) {
        return new HttpSender(config, HttpSender.Method.POST, StringFormat.KEY_VALUE_LIST, getCrashReporturl(""));
    }

    @Override
    public boolean enabled(@NonNull CoreConfiguration coreConfig) {
        return true;
    }
}

Version

  • Android: 12
  • ACRA 5.11.1 and 5.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions