Commit Graph

128 Commits

Author SHA1 Message Date
Roland Geider
0602244172 Report the device timezone to the profile 2026-08-23 23:19:38 +02:00
Roland Geider
a7e3b5cfdc Link the server's terms of service from the about page 2026-08-22 21:25:18 +02:00
Roland Geider
185e5341ba Merge remote-tracking branch 'origin/master' into feature/release-2.7 2026-08-21 22:37:02 +02:00
Roland Geider
2c26c93d68 Merge remote-tracking branch 'origin/master' into fix/build-phase-ui-side-effects 2026-08-21 18:01:56 +02:00
Roland Geider
095323f29b Merge pull request #1327 from wger-project/feature/better-online-gating
Better online gating
2026-08-21 17:48:01 +02:00
Roland Geider
de758b5dfa Final fixes 2026-08-21 17:42:28 +02:00
Roland Geider
8829c57191 Collapse the PowerSync SDK's repeated log lines 2026-08-21 17:30:50 +02:00
Roland Geider
a6534dbbd0 Reuse the dialog's local-counter snapshot for the report button 2026-08-21 16:05:02 +02:00
Roland Geider
2a596349df Report reachability from the bottom of the client stack 2026-08-21 16:04:52 +02:00
Roland Geider
a0fd3ad0e2 Make one provider the single Connectivity consumer 2026-08-21 15:29:52 +02:00
Roland Geider
9cb25ad538 Guard the probe pass against a mid-flight invalidation 2026-08-21 15:10:01 +02:00
Roland Geider
94d8352c3d Arm the sync watchdog inside connectPowerSync 2026-08-21 15:00:13 +02:00
Roland Geider
74fbb9db95 Coalesce overlapping reachability probes 2026-08-21 14:51:09 +02:00
Roland Geider
2073d462e6 Show a plain outage as disconnected, not as a sync error 2026-08-21 14:46:27 +02:00
Roland Geider
34b9b97081 Allow disabling the average and the trend lines 2026-08-20 18:56:51 +02:00
Roland Geider
16bc83c306 Allow users setting up calculated categories 2026-08-20 16:53: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
2374e1b0ba Replace flutter_svg_icons with a local SvgIcon widget 2026-08-15 21:52:07 +02:00
Roland Geider
d3749ac37c Report the local sync counters in bug reports 2026-08-15 20:22:19 +02:00
Roland Geider
fb88facda9 Report the local sync counters in bug reports 2026-08-15 20:20:19 +02:00
Roland Geider
afaa58c34e Report the local sync counters in bug reports 2026-08-15 19:21:05 +02:00
Roland Geider
67ed4d8ca1 Report the local sync counters in bug reports 2026-08-15 18:39:27 +02:00
Roland Geider
9a97202dd4 Cleanup 2026-08-14 17:37:47 +02:00
Roland Geider
23291513dc Fix logger name 2026-08-14 16:10:20 +02:00
Roland Geider
6e5555fe2f Mark the probe as in flight before the connectivity lookup 2026-08-14 16:09:32 +02:00
Roland Geider
fdee8e6935 Tell "connecting" apart from "offline" in the sync icon 2026-08-14 15:47:56 +02:00
Roland Geider
a986091ab8 Make the network status follow real traffic instead of a 1s probe 2026-08-14 15:20:45 +02:00
Roland Geider
5e332e18aa Connect PowerSync on the adapter state, not on the reachability probe 2026-08-14 14:52:49 +02:00
Roland Geider
d29e25de9b Throttle the health sync on app start 2026-08-13 18:34:01 +02:00
Roland Geider
47b91b0ad7 Show chart errors on the dashboard weight card 2026-08-13 18:27:54 +02:00
Roland Geider
fdbbdfc1d3 Merge PR #1260 (health sync) for 2.7 integration testing
# Conflicts:
#	lib/core/consts.dart
#	lib/core/network/auth_notifier.g.dart
#	lib/l10n/app_en.arb
#	pubspec.yaml
#	test/core/validators_test.mocks.dart
#	test/features/routines/providers/routines_repository_test.mocks.dart
#	test/screenshots/screenshots_03_gym_mode.dart
2026-08-13 14:22:32 +02:00
Roland Geider
dd2e37828d Merge PR #1248 (cross-midnight session split fix) for 2.7 integration testing
# Conflicts:
#	lib/core/network/auth_notifier.g.dart
#	lib/features/routines/providers/workout_logs_repository.dart
#	test/features/routines/providers/workout_logs_repository_test.dart
2026-08-13 14:13:53 +02:00
Roland Geider
4fd83ce202 Merge PR #1309 (remove old API token exchange) for 2.7 integration testing
# Conflicts:
#	lib/core/network/network_provider.g.dart
#	lib/database/powersync/powersync.g.dart
2026-08-13 14:10:24 +02:00
Ben Tucker
57fe12677c fix(auth): do not await PowerSync disconnect during session clear
A rejected refresh token runs clearSessionOnly inside the single-flight
refresh future. PowerSync's disconnect can block on an in-flight sync
fetch that is itself awaiting that same refresh future through
AuthHttpClient's pre-emptive refresh, closing a three-party cycle
(refresh -> disconnect -> sync fetch -> refresh) that permanently wedges
every authenticated request behind the never-completing refresh. The
session-expired message never appears because it is sequenced after the
hanging call, and an app restart re-triggers the same rejected refresh
during startup revalidation, so the deadlock re-forms immediately.

On the keep-data path the DB is not wiped, so there is no re-attach race
to guard against; the disconnect is only a courtesy stop of the sync
loop and is now fire-and-forget. The wipe path (explicit logout) keeps
its ordering. The disconnect hook is injectable for tests because
PowerSyncDatabase is a base class that cannot be faked.
2026-08-12 19:08:24 -05:00
Roland Geider
8fb4b12652 Rename the session times to datetimeStart and datetimeEnd 2026-08-10 17:53:03 +02:00
Roland Geider
2fbe9d59e1 Merge remote-tracking branch 'origin/master' into fix/midnight-workout-session-split--backend-2379
# Conflicts:
#	lib/features/routines/models/session.dart
#	lib/features/routines/providers/gym_state.dart
#	lib/features/routines/providers/workout_logs_repository.dart
#	lib/features/routines/widgets/forms/session.dart
#	lib/features/routines/widgets/gym_mode/session_page.dart
2026-08-10 17:16:55 +02:00
Roland Geider
520504a1b2 Merge branch 'master' into feature/health-sync 2026-08-10 15:13:43 +02:00
Roland Geider
e1af4c7ae7 Count calendar days in daysInRange 2026-08-10 10:09:21 +02:00
Roland Geider
aaacb6484c Keep the application logs across a restart 2026-08-09 22:49:04 +02:00
Roland Geider
b5cf828cb0 Add a setting for detailed logging 2026-08-09 22:47:48 +02:00
Roland Geider
9fdb13428b Add a filter and copy buttons to the log overview 2026-08-09 22:46:18 +02:00
Roland Geider
fb05d1e872 Log network state changes and the sync connection 2026-08-09 22:43:40 +02:00
Roland Geider
cc79af6188 Add exception text and UTC timestamps to the application logs 2026-08-09 22:42:36 +02:00
Roland Geider
7b6306703b Remove old API token exchange 2026-08-09 21:04:49 +02:00
Roland Geider
bb7ed8fa23 Say how long ago a tile's value was measured 2026-08-09 15:19:23 +02:00
Roland Geider
b5d092cfcc Persist the shared chart range 2026-08-09 13:45:12 +02:00
Sanji78
a9011c54c7 Fix user profile is unavailable with PowerSync 2026-08-09 09:11:13 +02:00
Roland Geider
251689cd31 Rebuild the measurements overview as a tile grid 2026-08-08 16:44:10 +02:00
Roland Geider
62e06d63a4 Share the quick steppers and the date-time pair 2026-08-07 22:05:48 +02:00
Roland Geider
d6de435c6b Make the measurements a tab of their own, led by the weight 2026-08-07 21:46:23 +02:00