screen-locker/stronglift_replacement/workout_app
Krzysztof kuhy Rudnicki 3de2928967 Fix workout_app widget tests hanging on sqflite-ffi DB ops
Pre-existing: any DB call (saveSession/getExerciseState/setExerciseWeight) made
directly in a testWidgets body runs in the fake-async zone and hangs sqflite-ffi
for ~3-4 min, then crashes the isolate ("Cannot close sink while adding stream"),
aborting the whole file. This blocked the pre-push flutter gate for any Dart-
touching commit. Two fixes:

- Wrap every in-body DB call in tester.runAsync(() => ...) so it runs on the real
  event loop (setUp already does; the passing tests did their reads inside the
  pump helper's runAsync). history/home/settings screen tests.
- StorageService._open: open the test ':memory:' DB with singleInstance:false so
  each test gets a fresh empty DB. sqflite's default singleInstance returned the
  same cached in-memory DB and resetForTesting never closed it, so rows piled up
  across tests and pushed the asserted widget off-screen ("Found 0 widgets").
  Production keeps the default single shared instance.

188 workout_app tests now pass (was aborting after ~4 min). Unrelated to the
manual-workout feature; needed to unblock its Dart commits.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PM3auNTifaVgcXWDizZrjH
2026-07-13 12:42:42 +02:00
..
android Add manual (unverified) workout logging with evidence form 2026-07-05 20:08:52 +02:00
assets/sounds fix: restore per-rep breaks with audio/vibration 2026-05-31 16:32:37 +02:00
lib Fix workout_app widget tests hanging on sqflite-ffi DB ops 2026-07-13 12:42:42 +02:00
test Fix workout_app widget tests hanging on sqflite-ffi DB ops 2026-07-13 12:42:42 +02:00
.gitignore feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
.metadata feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
analysis_options.yaml Add comprehensive test suite, backup service, and linting to workout app 2026-06-28 08:11:43 +02:00
CONTEXT.md feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
pubspec.lock Add phone-workout GitHub sync via shared crdt_sync (Workstream C) 2026-07-11 00:06:59 +02:00
pubspec.yaml Add phone-workout GitHub sync via shared crdt_sync (Workstream C) 2026-07-11 00:06:59 +02:00
README.md feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00

workout_app

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.