FrangSierra/RxFirebase

Default SetOptions should be OVERWRITE

johannesnormannjensen opened this issue · 1 comments

When setting a POJO the default SetOptions should be OVERWRITE so that Firestore conventions are followed

There seems to be no way of creating a SetOptions with merge = false? So this library would need to call another overload instead of passing SetOptions.merge()?
But this library is dead, right?

The bug should be here: https://github.com/FrangSierra/RxFirebase/blob/master/app/src/main/java/durdinapps/rxfirebase2/RxFirestore.java#L449

If anyone is stuck on this, I solved the problem locally by just doing what RxFirestore.set does internally:

   fun saveDeviceStatusOnline(d: FSDevice): Completable {
       val col = collection("client_info")
       val document = col.document(d.getDocumentPath())

       //return RxFirestore.setDocument(document, d).subscribeOn(Schedulers.io())
       return Completable.create { emitter ->
           RxCompletableHandler.assignOnTask<Void>(
               emitter,
               document.set(d)
           )
       }.subscribeOn(Schedulers.io())
   }