-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refs/heads/feat/profile/powersync #310
Draft
francelu
wants to merge
41
commits into
main
Choose a base branch
from
feat/profile/powersync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e` to enable a local cache of profile
…feat/profile/powersync # Conflicts: # app/src/main/java/com/android/periodpals/MainActivity.kt
3 tasks
…feat/profile/powersync # Conflicts: # app/src/main/java/com/android/periodpals/MainActivity.kt
…file/powersync # Conflicts: # app/src/main/java/com/android/periodpals/services/PushNotificationsServiceImpl.kt
…file/powersync # Conflicts: # app/src/main/java/com/android/periodpals/MainActivity.kt # app/src/main/java/com/android/periodpals/model/user/User.kt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PowerSync for profiles (written by Alonso)
Description
This will be an unfinished PR. This PR solves #278 and would have integrated an offline mode in PowerSync to sync locally the profiles. Essentially the app would have a local database SQLite containing their profiles. Unfortunately their does not seem to be an official way to unit test PowerSync in kotlin, there are alternatives in typescript but I could not figure out how to make it work for kotlin. Currently this branch, can read correctly any profile remotely (from Supabase) but can not correctly upsert the data back to supabase.
Changes
Added a new model that would implement the
UserRepository
interface but with PowerSync so this limited the number of files that needed to be changed. Most of the modified files are mostly due to modifications to adjust to the generalization. The most important file here would be theSchema
, that would describe the local database created for the users.Files
Added
app/src/main/java/com/android/periodpals/model/user/UserModelPowerSync.kt
app/src/main/java/com/android/periodpals/resources/Schema.kt
Modified
app/build.gradle.kts
app/src/main/java/com/android/periodpals/MainActivity.kt
app/src/main/java/com/android/periodpals/model/user/User.kt
app/src/main/java/com/android/periodpals/model/user/UserDto.kt
app/src/main/java/com/android/periodpals/model/user/UserViewModel.kt
Dependencies Added
com.powersync:core:1.0.0-BETA9
for the core of the PowerSync functionality and the local-first database model it offered.com.powersync:connector-supabase:1.0.0-BETA9
for the link with Supabase to connect with PowerSync services.com.powersync:compose:1.0.0-BETA11
for applications of PowerSync's methods to be called within composablesTesting
Unable to find testing methods for the new model class, the view model is already tested. There was a lack of time and resources, had to resort to the emulator and other people's phones.
Comments
I (Alonso) spent 2-3 weeks working on this and hitting every conceivable wall I could. Unfortunatly it couldn't be merged in time. PowerSync has been the death of me but to be honest I learned about PostgreSQL and SQLite, what buckets and transactions are, so perhaps worth for me.