Skip to content

Commit 9acce1f

Browse files
committed
minor readme update
1 parent ee5d059 commit 9acce1f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

demos/local-only-todolist/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ Insert the credentials of your new Supabase and PowerSync projects into `lib/app
4949

5050
# Explanation
5151

52-
The demo implements local-only and synced modes by using two sets of schema definitions, which can be viewed [here](./lib/models/schema.dart). The app initially starts in local-only mode with the offline schema. When the user signs in, the database schema is updated to the online schema, and the data is migrated to enable synchronization.
52+
The demo implements local-only and synced modes by using two sets of schema definitions, which can be viewed [here](./lib/models/schema.dart).
5353

54-
After this point, being signed in no longer determines which schema should be used, as the user's session expiring and explicitly signing out trigger different behaviors. If the session expires, the user can continue interacting with their data. However, if the user explicitly logs out, all data is cleared, effectively resetting the app. To manage this, an additional local storage mechanism is used to track which schema is currently in use, as seen [here](./lib/models/sync_mode.dart.dart). Note that any other local storage solution would work as long as it's not using the PowerSync database (chicken and egg problem).
54+
The first set doesn't record changes in an upload queue, this is achieved by using the localOnly table definition.
55+
When the user registers and sync must start, copy the data in the first schema over to a second set of regular / synced schema
56+
57+
At this point, being signed in no longer determines which schema should be used, as the user's session expiring and explicitly signing out trigger different behaviors. If the session expires, the user can continue interacting with their data. However, if the user explicitly logs out, all data is cleared, effectively resetting the app. To manage this, an additional local storage mechanism is used to track which schema is currently in use, as seen [here](./lib/models/sync_mode.dart). Note that any other local storage solution would work as long as it's not using the PowerSync database (chicken and egg problem).
5558

5659
## Flow chart
5760

0 commit comments

Comments
 (0)