aerogear / offix-android

Apollo GraphQL offline extensions for Android Platform
https://android.offix.dev
Apache License 2.0
37 stars 16 forks source link

Question - replace strategy for mutation persistence #56

Closed wtrocki closed 5 years ago

wtrocki commented 5 years ago

https://github.com/aerogear/offix-android/blob/693566cd6564cf4c6d2121715e02ff78573dda4a/offix-offline/src/main/java/org/aerogear/offixoffline/persistence/MutationDao.kt#L8

Any reason why we use replace? Is that a way to squash changes for single object?

harshithdwivedi commented 5 years ago

Hm , using replace might be better so that we always push the latest mutation on to the server; wdyt? BTW; we won't ever face this because the table has an autogenerated Primarykey; so I don't think that it'll ever face this conflict.

Lavanyagaur22 commented 5 years ago

Yeah right. Just in case a situation ever happen like this we are going to push the latest one in the database and then to the server.

wtrocki commented 5 years ago

Hm , using replace might be better so that we always push the latest mutation on to the server

Strange. I might need to chat about it more to understand. We should be pushing all mutations to the server.

I have tested that and in fact it works but I was just curious about this parameter. If we not using replace maybe we can drop this to be the default?

harshithdwivedi commented 5 years ago

Closing this since the issue seems to have been resolved. Please feel free to reopen if it isn't