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:
Julius Joska
2026-09-04 10:18:37 +02:00
parent f903e21e3a
commit 79ad411d7e
9 changed files with 193 additions and 5 deletions
@@ -8,6 +8,7 @@ import 'package:go_router/go_router.dart';
import 'package:path_provider/path_provider.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:sepot/core/app_info.dart';
import 'package:sepot/core/constants/app_constants.dart';
import 'package:sepot/core/l10n/error_messages.dart';
import 'package:sepot/core/l10n/l10n.dart';
@@ -181,7 +182,7 @@ class SettingsScreen extends ConsumerWidget {
_buildTile(
icon: Icons.info_outline,
title: l10n.commonAppName,
subtitle: l10n.settingsVersion(AppConstants.appVersion),
subtitle: l10n.settingsVersion(AppInfo.version),
onTap: () => _showAbout(context),
),
// Zdrojový kód je veřejný (AGPL-3.0). Detaily o licenci a odkaz
@@ -614,7 +615,7 @@ class SettingsScreen extends ConsumerWidget {
),
const SizedBox(height: 8),
Text(
ctx.l10n.settingsVersion(AppConstants.appVersion),
ctx.l10n.settingsVersion(AppInfo.version),
style: const TextStyle(color: SepotColors.textSecondary),
),
const SizedBox(height: 16),