Skip to content
Snippets Groups Projects
Verified Commit 9381c22e authored by Luc Everse's avatar Luc Everse :passport_control:
Browse files

Do not send (practically) empty reports

parent 8e28365a
No related branches found
No related tags found
2 merge requests!179Release 2.5.0,!177Submit integration
Pipeline #737511 failed
...@@ -275,7 +275,7 @@ public class SubmitAppController extends ControllerBase ...@@ -275,7 +275,7 @@ public class SubmitAppController extends ControllerBase
try { try {
final var report = this.reportGenerator.generateReport( final var report = this.reportGenerator.generateReport(
entityContainer, Set.of(e.getKey()) entityContainer, Set.of(e.getKey())
); ).trim();
this.sendFeedback(url, report, e.getValue(), submitMetadata, null, true); this.sendFeedback(url, report, e.getValue(), submitMetadata, null, true);
} catch (final IOException | TemplateException ex) { } catch (final IOException | TemplateException ex) {
...@@ -316,6 +316,8 @@ public class SubmitAppController extends ControllerBase ...@@ -316,6 +316,8 @@ public class SubmitAppController extends ControllerBase
/** /**
* Sends a report to Submit. * Sends a report to Submit.
* *
* If the report is empty, this does nothing.
*
* @param url the URL to send the feedback to * @param url the URL to send the feedback to
* @param report the report to send * @param report the report to send
* @param visibleFor for whom the report should be visible * @param visibleFor for whom the report should be visible
...@@ -332,6 +334,10 @@ public class SubmitAppController extends ControllerBase ...@@ -332,6 +334,10 @@ public class SubmitAppController extends ControllerBase
final @Nullable Integer score, final @Nullable Integer score,
final boolean success final boolean success
) { ) {
if (report != null && report.isEmpty()) {
return;
}
try { try {
final var conn = (HttpURLConnection) url.openConnection(); final var conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true); conn.setDoOutput(true);
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment