fix(app): read the version from the installed package
The version was a hand-written constant that had to be kept in sync with `version:` in pubspec.yaml. It was not: the constant still said 1.1.0 while the shipped build was 1.1.2+22, so every abuse report carried a version that no build ever had — and reports could not be traced back to a build. AppInfo reads versionName / CFBundleShortVersionString, which Flutter derives from the pubspec, so the two cannot drift apart again. Reports now carry the build number as well; when the version is not known yet the field is omitted rather than guessed. Also adds the timestamp regression test that covers MessagingService.wireSentAt, which shipped in 1.1.2 without its test.
This commit is contained in:
@@ -21,6 +21,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:sepot/core/app_info.dart';
|
||||
import 'package:sepot/core/constants/app_constants.dart';
|
||||
import 'package:sepot/core/errors.dart';
|
||||
|
||||
@@ -67,12 +68,16 @@ class ReportService {
|
||||
throw const ReportEmptyDescriptionError();
|
||||
}
|
||||
|
||||
// S build číslem, ne jen „1.1.2" — jinak nejde poznat, ze kterého buildu
|
||||
// hlášení přišlo. Neznámou verzi radši vynechat než poslat vymyšlenou.
|
||||
final verze = AppInfo.versionWithBuild;
|
||||
|
||||
final body = <String, dynamic>{
|
||||
'kategorie': category.wire,
|
||||
'popis': popis,
|
||||
'zdroj': 'app',
|
||||
'platforma': Platform.operatingSystem,
|
||||
'verze': AppConstants.appVersion,
|
||||
'verze': ?verze,
|
||||
if (reportedFingerprint != null && reportedFingerprint.isNotEmpty)
|
||||
'nahlasenyOtisk': reportedFingerprint,
|
||||
if (replyTo != null && replyTo.trim().isNotEmpty)
|
||||
|
||||
Reference in New Issue
Block a user