feat(inventory): auto-recover from a transient stream failure

Instead of showing a retry button on the first failure, silently re-open
the inventory stream with exponential backoff (250ms→4s, 6 attempts,
staying in the loading spinner). The startup DB-not-ready race clears in
well under a second, so the user just sees the spinner briefly and the
list appears — no tap needed. Only after the retry budget is exhausted do
we surface the manual-retry error.

Tests cover auto-recovery, no error flicker during retries, and the
give-up path (via fake_async to fast-forward the backoff).
This commit is contained in:
vjrj 2026-07-10 23:10:00 +02:00
parent 1666f5b31f
commit d9c2f46b79
3 changed files with 94 additions and 34 deletions

View file

@ -86,6 +86,8 @@ dev_dependencies:
sdk: flutter
flutter_lints: ^6.0.0
# Virtual clock to fast-forward the inventory auto-retry backoff in tests.
fake_async: ^1.3.1
build_runner: ^2.4.13
drift_dev: ^2.28.0
slang_build_runner: ^4.7.0