Commit Graph

16 Commits

Author SHA1 Message Date
Roland Geider
554a54e31b Finish the material_ui migration 2026-09-26 22:38:40 +02:00
pankaj-basnet
f7930ce68b fix: remove material_ui imports where not needed 2026-09-01 21:12:14 +05:45
pankaj-basnet
fee0079dc9 material ui: post-flutter-3.47 imports, dart fix applied 2026-09-01 21:08:51 +05:45
Roland Geider
3f92631a89 Pre-fill the app version in bug reports 2026-08-27 21:19:10 +02:00
Ben Tucker
fe33f693a8 fix(core): make UI side effects and provider reads safe during build
Errors handled while the widget tree is building crashed or wedged the
app in three related ways:

- FlutterError.onError showed dialogs and snackbars synchronously.
  Pushing a route mid-build trips the navigator's !_debugLocked
  assertion, and because the one-dialog guard was set before showDialog
  threw, its release never attached: every later error dialog was then
  silently suppressed while nothing was on screen, leaving a blank,
  unresponsive app until restart. Snackbars crashed outright via the
  messenger's setState.
- The sync status and barcode dialogs did ref.read inside their route
  builders, which run during build. With the provider chain dirty (any
  token refresh dirties wgerBase -> auth), the read flushed it there and
  Riverpod scheduled a scope refresh mid-build. The barcode builder also
  created its search future inline, re-firing the search on every dialog
  rebuild.
- Provider create bodies that widgets watch during build read providers
  synchronously: the dashboard's routine hydration chain crashed on cold
  start right after a token refresh, and TrophyStateNotifier.build()
  has the same shape in the post-login window, where invalidation order
  left networkStatusProvider dirty while its dependents rebuilt.

lib/core/build_safety.dart adds the two idioms as helpers: runAfterFrame
defers UI side effects past the build phase, yieldPastBuild yields
provider create bodies past their synchronous phase (a microtask, not a
timer, since widget tests assert !timersPending at teardown). The error
dialog guard is released when the context is gone or the push fails, the
snackbar helpers re-resolve the messenger inside the callback, the
dialog builders snapshot their providers in the tap handler, and
post-login invalidation runs leaf-first. Regression tests cover each
shape.
2026-08-16 17:29:43 -05:00
Roland Geider
9fdb13428b Add a filter and copy buttons to the log overview 2026-08-09 22:46:18 +02:00
Roland Geider
1af9471ef4 Replace more hard coded colors with theme generated ones 2026-08-04 11:41:17 +02:00
Roland Geider
718fa05d1b Add sync diagnostics to the "submit to github" error dialog 2026-07-29 17:06:05 +02:00
Roland Geider
60c9f67282 Move shared infra to lib/core/ 2026-07-01 20:28:06 +02:00
Roland Geider
bfb44c2157 Extract title from html error messages 2026-06-17 21:39:51 +02:00
Roland Geider
177a48d6c7 Fix use_build_context_synchronously and unused_local_variable lint warnings 2026-06-15 22:45:11 +02:00
Roland Geider
5f9abdb15f Slight refactor of the error handling
This moves some of the pieces to the correct places
2026-06-14 21:25:59 +02:00
Roland Geider
57947eabe6 Don't default to black text
Otherwise this might be unreadable on dark mode
2026-06-05 14:47:36 +02:00
Roland Geider
ca2530ecab Better error handling for powersync errors
This new logic properly handles retriable and transient errors
2026-06-04 20:41:06 +02:00
Roland Geider
736cb41cb2 Improve the login process
The previous process was depending too much on the backend being available, we
can now bypass many of these checks if the user had already logged in before
2026-05-22 19:19:00 +02:00
Roland Geider
d97de48fee Refactor the error logic
UI related functions have been moved to error_dialogs.dart, while everything else
is kept in errors.dart
2026-05-22 15:50:33 +02:00