steroid-team / app

Helping you organise your day with ease and privacy.
1 stars 2 forks source link

Feature/simple local cache #242

Closed theo-damiani closed 3 years ago

theo-damiani commented 3 years ago

SimpleLocalCache: addressed #235 Refactor viewModel: addressed #196 Fix Bug: #237

theo-damiani commented 3 years ago

Hey, I tested the PR and it works well! Here are the steps I used:

* Open the app in my emulator, make some changes, notice there is no latency

* Open the app this time in my phone, observe that all the changes I made on the emulator have indeed been saved

* Go back to the emulator, make more changes but this time without internet connectivity

* Reconnect to the internet

* Go back to the phone, observe that all the changes I made on the emulator have indeed been saved

Only small problem I found is that the Firebase synchronizing (for the changes from the emulator to my phone) could take a bit of time, even though I made sure to restart the app. I don't know if this is a new issue as I never tried this before.

Thanks for the review!

I think the delay will come from the syncData() method in the repository, and as it iterates over all todo and note maybe it can be slow. And for the changes, keep in mind that the offline functionality is simple:

VPellenc commented 3 years ago

Hey, I tested the PR and it works well! Here are the steps I used:

* Open the app in my emulator, make some changes, notice there is no latency

* Open the app this time in my phone, observe that all the changes I made on the emulator have indeed been saved

* Go back to the emulator, make more changes but this time without internet connectivity

* Reconnect to the internet

* Go back to the phone, observe that all the changes I made on the emulator have indeed been saved

Only small problem I found is that the Firebase synchronizing (for the changes from the emulator to my phone) could take a bit of time, even though I made sure to restart the app. I don't know if this is a new issue as I never tried this before.

Thanks for the review!

I think the delay will come from the syncData() method in the repository, and as it iterates over all todo and note maybe it can be slow. And for the changes, keep in mind that the offline functionality is simple:

  • all objects in the remote database are downloaded in the local one.
  • all objects in the local database that are not in the remote database, are deleted.
  • it takes the most recent objects if he is present in both.

Okay, good for me!