Report the local sync counters in bug reports

This commit is contained in:
Roland Geider
2026-08-15 18:39:27 +02:00
parent 534d349d19
commit 67ed4d8ca1
5 changed files with 164 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ import 'package:powersync/powersync.dart'
SyncResponseException,
SyncStatus,
UpdateType;
import 'package:wger/core/error_dialogs.dart' show CopyToClipboardButton;
import 'package:wger/core/widgets/sync_status_dialog.dart';
import 'package:wger/database/powersync/powersync.dart'
show pendingUploadCountProvider, syncStatus, syncWatchdogProvider;
@@ -150,6 +151,17 @@ void main() {
expect(find.byType(LinearProgressIndicator), findsNothing);
});
testWidgets('offers the snapshot for copying even when nothing looks wrong', (tester) async {
// The state we keep getting reports about: no error, not stalled, so
// the report button stays hidden and copying is the only way out.
await _pumpDialog(tester, buildSyncStatus());
expect(find.text('Report issue'), findsNothing);
final button = tester.widget<CopyToClipboardButton>(find.byType(CopyToClipboardButton));
expect(button.text, contains('last successful sync: never'));
expect(button.text, contains('pending uploads: 0'));
});
testWidgets('renders the placeholder while the sync state is still unknown', (tester) async {
await _pumpDialog(tester, buildUninitializedSyncStatus());