Optimize deployment, fix E2E flakiness, and implement database-backed threading

- Optimize task deploy-android with marker files and source/generate tracking.
- Fix flaky Android E2E test with pumpAndSettle and safety delays.
- Implement global CrashScreen and error handlers in main.dart.
- Refactor threading to use a persistent Threads table for performance.
- Add database indexes and migration for schema v18.
- Enhance coverage gate with ghost path checks and increased coverage (82%).
This commit is contained in:
Thomas Güttler
2026-05-07 22:07:54 +02:00
parent 3c90818845
commit 656d4b46d7
9 changed files with 550 additions and 59 deletions
+44 -3
View File
@@ -1,14 +1,55 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:sharedinbox/data/db/database.dart';
import 'package:sharedinbox/di.dart';
import 'package:sharedinbox/ui/router.dart';
import 'package:sharedinbox/ui/screens/crash_screen.dart';
void main({List<Override> overrides = const []}) async {
WidgetsFlutterBinding.ensureInitialized();
await initDatabasePath();
runApp(ProviderScope(overrides: overrides, child: const SharedInboxApp()));
unawaited(
runZonedGuarded(
() async {
WidgetsFlutterBinding.ensureInitialized();
// Catch errors during build (e.g. layout exceptions) and show CrashScreen.
ErrorWidget.builder = (details) => CrashScreen(
exception: details.exception,
stackTrace: details.stack,
);
// Catch framework-level errors (e.g. from gestures, timers).
FlutterError.onError = (details) {
FlutterError.presentError(details);
runApp(
CrashScreen(
exception: details.exception,
stackTrace: details.stack,
),
);
};
await initDatabasePath();
runApp(
ProviderScope(
overrides: overrides,
child: const SharedInboxApp(),
),
);
},
(error, stack) {
// Catch unhandled async errors.
runApp(
CrashScreen(
exception: error,
stackTrace: stack,
),
);
},
),
);
}
class SharedInboxApp extends ConsumerStatefulWidget {