Skip to content

Offline mode#1183

Merged
rolandgeider merged 314 commits into
masterfrom
feature/offline-mode
Jun 15, 2026
Merged

Offline mode#1183
rolandgeider merged 314 commits into
masterfrom
feature/offline-mode

Conversation

@rolandgeider

@rolandgeider rolandgeider commented Apr 23, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Note: this needs a powersync service running additionally to the regular backend. The way this works is that you use a local sqlite database on the device and powersync takes care of making sure new entries are synced once you're connected to the internet again. Note that this doesn't make the whole application work offline, as some entries such as the routines need some backend logic that we don't want to replicate (also, this transparently and smoothly takes care of keeping the exercise db in sync). These parts are aware there is no network connectivity and won't endlessly try to fetch the data, so you can open your routine and go to the gym where there's no internet and log everything.

Also all providers were moved to riverpod since it made working with the new ones much easier and due to these refactors the PR should also get rid of all the weird loading bugs we had in the past.

Related Issue(s)

Offline mode
Closes #6 🥳
Closes #12

All kinds of miscellaneous "can't load x", "doesn't show y", "timeout at x" issues
Closes #51
Closes #548
Closes #558
Closes #577
Closes #722
Closes #861
Closes #867
Closes #881
Closes #936
Closes #983
Closes #1035
Closes #1054
Closes #1055
Closes #1063
Closes #1070
Closes #1089
Closes #1103
Closes #1114
Closes #1133
Closes #1147
Closes #1152
Closes #1163
Closes #1193
Closes #1199

Since this also allows using all auth-options the backend does, also
Closes #302

Needs backend wger-project/wger#1747

These are now together with the "regular" drift definitions, making it
easier to spot any differences that may creep in
The backend now saves uses a UUID for the IDs as well, which we can now use directly
# Conflicts:
#	integration_test/1_dashboard.dart
#	integration_test/3_gym_mode.dart
#	ios/Podfile.lock
#	lib/database/exercises/exercise_database.dart
#	lib/database/exercises/type_converters.dart
#	lib/models/exercises/exercise.dart
#	lib/models/exercises/exercise.g.dart
#	lib/models/exercises/exercise_api.dart
#	lib/models/exercises/exercise_api.freezed.dart
#	lib/models/exercises/exercise_api.g.dart
#	lib/models/exercises/translation.dart
#	lib/models/exercises/translation.g.dart
#	lib/models/exercises/variation.dart
#	lib/providers/exercises.dart
#	lib/widgets/add_exercise/steps/step_1_basics.dart
#	lib/widgets/add_exercise/steps/step_2_variations.dart
#	lib/widgets/exercises/exercises.dart
#	lib/widgets/measurements/forms.dart
#	lib/widgets/routines/forms/slot.dart
#	pubspec.lock
#	pubspec.yaml
#	test/core/settings_test.mocks.dart
#	test/exercises/contribute_exercise_image_test.mocks.dart
#	test/exercises/contribute_exercise_test.mocks.dart
#	test/exercises/exercise_provider_load_test.dart
#	test/exercises/exercise_provider_test.dart
#	test/exercises/exercises_detail_widget_test.dart
#	test/exercises/exercises_detail_widget_test.mocks.dart
#	test/exercises/model_exercise_test.dart
#	test/measurements/measurement_entries_screen_test.dart
#	test/routine/gym_mode/gym_mode_test.dart
#	test/routine/gym_mode/gym_mode_test.mocks.dart
#	test/routine/routines_provider_test.mocks.dart
#	test/weight/weight_screen_test.mocks.dart
#	test/widgets/routines/gym_mode/log_page_test.mocks.dart
#	test_data/measurements.dart
The widgets take care of loading the data they need
This makes the behaviour consistent with the others
The logs are read in the session repository, the logs one is only used
for CRUD operations
While not very probable, it can happen that a routine etc was deleted on the server
at the same time that a user had opened its detail page. We also changed the argument
for the nutrition screen to ID, for more consistency with the other ones.
Otherwise this might be unreadable on dark mode
This makes the logic a bit more robust on null pages
This moves some of the pieces to the correct places
# Conflicts:
#	lib/l10n/app_de.arb
#	lib/widgets/routines/forms/repetitions.dart
#	lib/widgets/routines/forms/weight.dart
@rolandgeider rolandgeider merged commit 3e8da06 into master Jun 15, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Release 2.6 Jun 15, 2026
@DanielHouston

Copy link
Copy Markdown

Fantastic that this has made it in! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next version Incompatible changes that will be merged for the next version

Projects

Status: Done

3 participants