Jean28518 / linux-assistant

A daily linux helper with powerful integrated search, routines checks and administrative tasks. The Project is built with flutter and python.
https://www.linux-assistant.org
GNU General Public License v3.0
90 stars 12 forks source link

Was passiert, wenn das senden des Feedback nicht in 10 sekunden erfolgreich war, kommt dann trotzdem die Meldung das es fiunktioiet hat? #205

Closed georg41980 closed 2 months ago

georg41980 commented 4 months ago

Was passiert, wenn das senden des Feedback nicht in 10 sekunden erfolgreich war, kommt dann trotzdem die Meldung das es fiunktioiet hat? Wrd dann weiter versucht bis es erfogrech ist?

import 'dart:convert';

import 'package:linux_assistant/models/action_entry.dart'; import 'package:http/http.dart' as http; import 'package:linux_assistant/services/linux.dart';

class FeedbackService { static Future send_feedback( String message, List entries, String searchTerm, bool includeBasicSystemInformation, bool includeSearchTermnAndSearchResults) async { List<Map<String, dynamic>> entriesJson = [];

if (!includeSearchTermnAndSearchResults) {
  searchTerm = "!Not included!";
} else {
  for (var element in entries) {
    entriesJson.add(element.toJson());
  }
}

Map<String, dynamic> environment;
if (!includeBasicSystemInformation) {
  environment = <String, dynamic>{};
} else {
  environment = Linux.currentenvironment.toJson();
}

http.Response response = await http
    .post(
      Uri.parse('https://feedback.server-jean.de/submit/'),
      headers: <String, String>{
        'Content-Type': 'application/json; charset=UTF-8',
      },
      body: jsonEncode(<String, dynamic>{
        'message': message,
        'entries': entriesJson,
        'searchTerm': searchTerm,
        'environment': environment,
      }),
    )
    .timeout(const Duration(seconds: 10));

return (response.statusCode == 200);

} }

Jean28518 commented 2 months ago

Duplicate to #206